Skip to main content

Boost-Supported RegEx Character Classes

Boost.Regex always supports these class names:

Name

POSIX-Standard Name

Description

Example

[:alnum:]

Yes

Alpha-numeric Characters

[A-Za-z0-9]

[:alpha:]

Yes

Alphabetic Characters

[A-Za-z]

[:blank:]

Yes

Whitespace characters that are not line separators.

space or tab

[:cntrl:]

Yes

Control Characters

Any character not part of the character class: [:upper:], [:lower:], [:alpha:], [:digit:], [:punct:], [:graph:], [:print:], [:xdigit:]

[:d:]

No

Decimal Digits

[0–9]

[:digit:]

Yes

Decimal Digits

[0–9]

[:graph:]

Yes

Characters with graphic representation.

[A–Z][a–z][0–9][:punct:]

[:l:]

No

Lowercase Characters

[a–z]

[:lower:]

Yes

Lowercase Characters

[a–z]

[:print:]

Yes

Characters that display when printed.

[:graph:] and space

[:punct:]

Yes

Punctuation Characters

! ' # S % & ' ( ) * + , - . / : ; < = > ? @ [ / ] ^ _ { | } ~

[:s:]

No

Whitespace Characters

tab, new line, vertical tab, form feed, carriage return, space

[:space:]

Yes

Whitespace Characters

tab, new line, vertical tab, form feed, carriage return, space

[:unicode:]

No

Extended characters whose code point value is above 255.

Any character with code point above 255.

[:u:]

No

Uppercase Characters

[A–Z]

[:upper:]

Yes

Uppercase Characters

[A–Z]

[:w:]

No

Alphanumeric characters and underscore.

[A-Za-z0-9_]

[:word:]

No

Alphanumeric characters and underscore.

[A-Za-z0-9_]

[:xdigit:]

Yes

Hexadecimal Digit Characters

[A-Fa-f0-9]