Everthing in an element

Published on Tue Mar 01 2022

Additional matching regexes for
Everthing in an element

Regex

Match an element from a list

BEM

CSS Coding Guideline **BEM** (Block Element Modifier)

Match text in square brackets

Drupal7 Media Element in node body - A regex to match the media module square bracketted token/element for embedde images in node body. Use case - using the body text trimmed in a meta description - need to remove the media element as well as strip tags.

Match Ice Faces Empty RTF

Will match any empty or containing whitespace only Ice Faces Rich Text Input element.

Element's Attribute Value in XML (simple)

Simple regular expression for extracting attribute value of the element in XML-string. Attribute value should be in quotes.

Replace caracters not inside HTM tags

Select a character (or string) ingnoring if that element is inside the HTML tags. Useful to apply html tags using replace.

Gitlab GraphQl query finder

Searches for the first list element in a graphql query, which allows for filtering and pagination, except for the group node

Div shortcode [div]..[/div]

Converts the markdown shortcode for the dive element to the regular HTML: Example shortcode: [div id="bla" class="ups"]some multiple line text[/div]

Browser Console - Format Specifier

Captures format specifiers commonly used in logging and console messages, as defined in [the current whatwg/console spec](https://console.spec.whatwg.org/#formatter): - `%s`: Formats the value as a string - `%i`: Formats the value as an integer - `%d`: Formats the value as an integer - `%f`: Formats the value as a floating point value - `%o`: Formats the value as an expandable DOM element. As seen in the Elements panel - `%O`: Formats the value as an expandable JavaScript object - `%c`: Applies CSS style rules to the output string as specified by the second parameter

Browser Console - Format Specifier

Captures format specifiers commonly used in logging and console messages, as defined in [the current whatwg/console spec](https://console.spec.whatwg.org/#formatter): - `%s`: Formats the value as a string - `%i`: Formats the value as an integer - `%d`: Formats the value as an integer - `%f`: Formats the value as a floating point value - `%o`: Formats the value as an expandable DOM element. As seen in the Elements panel - `%O`: Formats the value as an expandable JavaScript object - `%c`: Applies CSS style rules to the output string as specified by the second parameter