Skip to content

Regex Identifiers

Word Character (\w)

The word character \w matches any alphanumeric character and underscore.

For example, the regex pattern \w+ matches hello_world.

Non-Word Characters (\W)

The non-word character \W matches any character that is not alphanumeric or underscore.

For example, the regex pattern \W+ matches @#$% .

Numeric Character (\d)

The number character \d matches any digit.

For example, the regex pattern \d+ matches 123.

Non-Numeric Character (\D)

The non-numeric character \D matches any character that is not a digit.

For example, the regex pattern \D+ matches abc.

Space Character (\s)

The space character \s matches any whitespace character.

For example, the regex pattern \s+ matches .

Non-Space Character (\S)

The non-space character \S matches any character that is not whitespace.

For example, the regex pattern \S+ matches hello.