Regular Expressions 101

Community Patterns

0

Michele XP E

ECMAScript (JavaScript)
Teste
Submitted by Luciano - 2 years ago
0

hk_ec_lanecrawford

PCRE2 (PHP >=7.3)
Submitted by Alex - 2 years ago
0

address

PCRE (PHP <7.3)
not sure
Submitted by anonymous - 2 years ago
0

1030

ECMAScript (JavaScript)
Validation
Submitted by Christopher Santos - 2 years ago
0

IPv6

PCRE2 (PHP >=7.3)
small ipv6 regex
Submitted by anonymous - 2 years ago

Get path from any text

15

Regular Expression
Recommended
PCRE2 (PHP >=7.3)

/
(?<opening>\b(?<montage>[a-zA-Z]:[\/\\])|[\/\\][\/\\](?<!http:\/\/)(?<!https:\/\/)(?>[?.][\/\\](?:[^\/\\<>:"|?\n\r ]+[\/\\])?(?&montage)?|(?!(?&montage)))|%\w+%[\/\\]?)(?:[^\/\\<>:"|?\n\r ,'][^\/\\<>:"|?\n\r]*(?<![ ,'])[\/\\])*(?:(?=[^\/\\<>:"'|?\n\r;, ])(?:(?:[^\/\\<>:"|?\n\r;, .](?: (?=[\w\-]))?(?:\*(?!= ))?(?!(?&montage)))+)?(?:\.\w+)*)|(?:'(?&opening)(?=.*'\W|.*'$)(?:[^\/\\<>:'"|?\n\r]+(?:'(?=\w))?[\/\\]?)*')|"(?&opening)(?=.*")(?:[^\/\\<>:"|?\n\r]+[\/\\]?)*"
/
g

Description

Loading markdown...
Submitted by nitrateag - a year ago
(Last modified 7 months ago)