Get value from string

Published on Tue Mar 01 2022

Used to get a value from a class e.g.: [...] class="font-12"[...] This regEx will receive "12" given the content of the class

Additional matching regexes for
Get value from string

Get value from string

Used to get a value from a class e.g.: [...] class="font-12"[...] This regEx will receive "12" given the content of the class

Find Italic

Find <SPAN> Html TAG with "Italic" class and returns his content.

csv parsing

csv parsing with content quota string

Extract All Steam Keys

Extract all Steam Keys from a Given String

html color match: transparent, #fff, #123456, rgb, rgba, hsl, hsla

This may be useful or not to test whether a given string is a valid (more or less) html color value. It matches color values such as: - #123 - short hex color value - #123456 - hex color value - rgb(255,255,0) - rgb color value - rgba(255,255,0,1.0) - rgba color value - hsl(360,100%,100%) - hsl color value - hsla(360,100%,100%,0.5334) - hsla color value Regex allows whitespaces between i.e. rgb and (, also between numbers and commas, but not in value like 55% between number and percentage. To change this behaviour simply remove \s*? from appriopriate places.

Extract Fields from Mailexpire

Given the HTML of an alias's control panel, apply the XPath "//span[@class='maintext']". The second result returned can be parsed by this regex to yield the most pertinent field names and their values.

Phone number tests

Test a given string for phone number variations and extract th parts.

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.

Svelte: CSS class attribute (Svelte or HTML friendly), class:directive, TailwindCSS classes, and @apply.

# SvelteComponent Class Directive Matching Also supports TailwindCSS-style `@apply` directive for the class value. ## `class:directive={boolean}` Svelte allows us to provide a "class directive", or a class name in the form of `class:NAME={boolean}`. If we place a boolean (or function that returns a boolean) as its value, it will add the class "NAME" to the component when it returns true, or omit it when false. This is extremely useful for navigation components, and I use it all the time to highlight active links in my UX/UI development process. ```svelte <NavBar> <Link href="#abc" class:active={page === 'abc'}>ABC</Link> <Link href="#xyz" class:active={page === 'xyz'}>XYZ</Link> </NavBar> ``` Flexible matching for the class attribute on both **Svelte Components** and **HTML Elements**.

Anything sorounded by " "

Match anything inside double quote string and set the first capture group with the content