Regular Expressions 101

Sponsors

Library entries

0
pcre2

find supertype of

for express
Submitted by anonymous - 4 hours ago
0
pcre2

Hardware ID

Checks whether the input is a hardware ID
Submitted by Justman10000 - 19 hours ago
0
pcre2

MD highlight remover

Remove highlights from md files
Submitted by anonymous - 2 days ago
0
pcre2

MD higlighter

Mark words to auto-higlight
Submitted by anonymous - 2 days ago
0
pcre2

perga

regex to find total payment
Submitted by anonymous - 4 days ago
0
pcre2

Match markdown order and unorder list

Same as title
Submitted by anonymous - 4 days ago
0
pcre2

CSS Class Styles

Regex to find CSS Class Styles
Submitted by JR - 6 days ago
0
javascript

Match HTML tag with specific attributes

1
Submitted by anonymous - 7 days ago

Palindromes

Vote

2

Regular Expression
pcre2

/
(?(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_ - 2 months ago