Regular Expressions 101

Community Patterns

0

C######

PCRE2 (PHP >=7.3)
get C with numbers string
Submitted by Didier - 2 years ago
0

All

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

url-selection

PCRE2 (PHP >=7.3)
url-selection
Submitted by anonymous - 2 years ago
0

FindQuoteDiv

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

URL

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

Look Ahead

PCRE2 (PHP >=7.3)
Look Ahead
Submitted by anonymous - 2 years ago

Palindromes

2

Regular Expression
PCRE2 (PHP >=7.3)

/
(?(DEFINE) (?<palindrome> # Recursive alternative first to match recursive palindromes. # Invert alternatives order to match nested palindromes individually # and (drastically) reduce backtracking. (?<l1>\p{L})\p{M}* [\s\p{P}]* (?&palindrome) [\s\p{P}]* \k<l1>\p{M}* | (?<l2>\p{L})\p{M}* [\s\p{P}]* \k<l2>\p{M}* | \p{L}\p{M}* ) ) (?<=[\s\p{P}]|^) (?&palindrome) (?(?=\s*\p{P}) (?:\s*\p{P})+ | (?=\s|$))
/
gix

Description

Loading markdown...
Submitted by NicolaF_ - a year ago
(Last modified a year ago)