🦖 Rexx

A human-friendly regex library with structured syntax and variable support.

Cheat sheet

Rexx RegExp Rexx RegExp
one_of { 'a', 'b', 'c' } [abc] word \w
one_of { 'foo', 'bar' } foo|bar non_word \W
one_of { range {'a', 'z'} } [a-z] digit \d
optional {'a'} / loop(0..1) {'a'} a? non_digit \D
optional {'abc'} (?:abc)? whitespace \s
loop(0..) {'a'} a* non_whitespace \S
one_or_more {'a'} / loop(1..) {'a'} a+ boundary \b
loop(2) {'a'} a{2} non_boundary \B
loop(2..3) {'a'} a{2,3} chinese [\u4e00-\u9fa5]
except {'a'} [^a] '\\d' \d
except { range {'a', 'z'} } [^a-z] '\\uffff' \uffff
group{'foo'} (foo) newline \n
group('year'){'2024'} (?<year>2024) tab \t
ref {1} \1 any .
ref {year} \k<year> begin ^
followed_by {'a'} (?=a) end $
not_followed_by {'a'} (?!a) global g
preceded_by {'a'} (?<=) ignore_case i
not_preceded_by {'a'} (?<!) multiline m
loop (1..) {'a'} lazy a+?