Skip to content
On this page

Regex (Regular Expression)

Regular expressions are delineated with two forward slashes, optionally followed directly with supported flags

Here are some examples

/[a-z]/
/[a-zA-Z0-9]/gi

Supported Flags

A flag changes the default searching behavior of a regular expression. It makes a regex search in a different way.

A flag is denoted using a single lowercase alphabetic character.

joelang supports these flags, each serving a different purpose.

FlagNamePurpose
gGlobalFinds all occurences
iIgnore casingMakes the regular expression ignore case
mMultilineMakes the boundary characters ^ and $ match the beginning and end of every line instead of the beginning and end of the string
sDot allMakes the wild character . match newlines as well