math chain comparisons with optional matched paren

Published on Tue Mar 01 2022

Additional matching regexes for
math chain comparisons with optional matched paren

paren strip test

paren strip test

include case

How to include the matched cases in the result?

Phone Number

Allows phone numbers with optional country code, optional special characters and whitespace

Phone Number Validation

Only Numbers Allowed, Optional (+) for international numbers Min: 10 Max: 14 Optional: +

Currency amount validation with sign (cents optional)

Allows Number: Currency amount US (cents optional) Can use US-style 123,456.78 notation Optional thousands separators; optional two-digit fraction; commas; dollar sign

Any number between 0 and 10 with 0 or 1 decimal places

Matches any number between 0 and 10 (inclusive) with 0 or 1 decimal places. Note that .5 will NOT be matched but 0.5 will. Also 10.X will not be matched, but 10 will.

Regex to match any JSON value with fewer steps possible

If you find... - any JSON value that should be matched but isn't, - any JSON value that should NOT be matched but is - or simply a way to match the values with fewer steps... please, let me know.

Signed numbers with optional decimal part (comma or dot)

Signed numbers with optional decimal part (comma or dot)

Domain from URL

Matches everything before after // or www and before a period. If needed, replace the matched elements with blanks.

HSL(A) Color Matching

This allows for both hsl and hsla color patterns to be matched. `hsla(50.5deg, .531%, .9%, 1.0)` - The hue can be matched without the word `deg`. - Hue is from 0-360 - Percentage allows for decimals. - Percentage is from 0-100% - Alpha is from 0.0-1.0