Regular Expressions 101

Community Patterns

5

ipv6

PCRE (PHP <7.3)
Match an ipv6 address
Submitted by Frusty - 8 years ago
9

only numbers

PCRE (PHP <7.3)
A string with only numbers in
Submitted by Gotts - 8 years ago

parsing CSV file

5

Regular Expression
PCRE (PHP <7.3)

/
(?:(?<=^)|(?<=,)) # start of line or comma (?:(?!$)\s)* # skip whitespace "? # skip opening quote mark ( (?<=").*?(?=") # capture value in quotes | # or ((?!,)\S)* # capture just value ) "? # skip closing quote mark (?:(?!$)\s)* # skip whitespace (?=$|,) # command or the end of the line
/
gmx

Description

Loading markdown...
Submitted by Viktor Lova aka nsinreal - 9 years ago