Utilities

sanitize()

Escape characters expected special by regex engines

Rules

any()

Match any of these characters exactly once (alias of any_of()).

any_of()

Match any of these characters exactly once.

anything()

Match any character(s) any (including zero) number of times.

anything_but()

Match any character(s) except these any (including zero) number of times.

end_of_line()

Match the expression only if it appears till the end of the line.

find()

Match an expression (alias for then()).

maybe()

Optionally match an expression.

range()

Match any character within the range defined by the parameters.

something()

Match any character(s) at least once.

something_but()

Match any character(s) except these at least once.

start_of_line()

Match the expression only if it appears from beginning of line.

then()

Match an expression

Loops

one_or_more()

Match the previous stuff one or more times.

Special Characters

br()

Match a line break (alias of line_break()).

digit()

Match a digit (0–9).

line_break()

Match a line break.

tab()

Match a tab character.

whitespace()

Match a whitespace character.

word()

Match a word.

Capture Groups

begin_capture()

Begin a capture group.

end_capture()

End a capture group.

Modifiers

with_any_case()

Control case-insensitive matching.