Regular Expressions 101

Sponsors

Library entries

2
pcre

update match

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

mask the credit card number

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

Email Domain Regex

A pattern to match the email domain suffix
Submitted by doug - 7 years ago
2
pcre

5

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

YouTube Iframe parser

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

find numbers with 2 commas

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

Any variable between @

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

IP with Subnet

IP address with Subnet
Submitted by Matt Masse - 7 years ago
2
pcre

1

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

test

test
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 - 4 years ago