Regular Expressions 101

Sponsors

Library entries

2
pcre

Extract Metadata

no description available
Submitted by kai_desu - 7 years ago
2
pcre

Matches first word

no description available
Submitted by anonymous - 7 years ago
2
pcre

paren strip test

paren strip test
Submitted by marie bacuno - 7 years ago
2
python

Twitch URL Regex

Can grab all kinds of valid twitch URLs.
Submitted by Mio - 7 years ago
2
pcre

catch options

catch options
Submitted by Marek R - 7 years ago
2
pcre

Dice Regex with Modifier

no description available
Submitted by derek robati - 7 years ago
2
python

Find any digits in string

no description available
Submitted by anonymous - 7 years ago
2
python

selectin multiple image pattern

no description available
Submitted by cool_jesus - 7 years ago
2
pcre

BZWBK24 SMS Code

no description available
Submitted by maniekq - 7 years ago
2
python

Match 5 forward slashes

Match 5 forward slashes
Submitted by anonymous - 7 years ago

Regex to match any JSON value with fewer steps possible

Vote

2

Regular Expression
pcre

/
(?smx) (?(DEFINE) (?<jsonObject> \{(?&jsonField)(?>,(?&jsonField))*+\}| \{[[:space:]]*+\} ) (?<jsonArray> \[(?&jsonValue)(?>,(?&jsonValue))*+\]| \[[[:space:]]*+\] ) (?<string> " [^"\\]*+ (?> (?> \\["\\\/rntfb]| \\u[[:xdigit:]]{4} )++ [^"\\]*+ )*+ " ) (?<number> \-?+ (?> [1-9][[:digit:]]*+| 0 ) (?>\.[[:digit:]]++)?+ (?>[eE][\+\-]?+[[:digit:]]++)?+ ) (?<jsonValue> [[:space:]]*+ (?> (?&string)| (?&number)| (?&jsonObject)| (?&jsonArray)| false| true| null ) [[:space:]]*+ ) (?<jsonField> [[:space:]]*+(?&string)[[:space:]]*+\: (?&jsonValue) ) ) ^(?&jsonValue),\n
/
g

Description

Loading markdown...
Submitted by anonymous - 3 years ago