Feature: Character Class Nested Set
Home | Features | Improve this section
A Character Class Nested Set allows you to to define a nested character class inside of a character class.
Syntax
NOTE: The following syntax is an example based on some of the supported engines. For specific engine support, see Engines.
[[…]]
— Matches any character in the set, just like a normal character class.[[^…]]
— Where…
is one or more single characters or character class escapes, excluding-
between two entries in the set. Matches any character not in the set, just like a normal [negated character class].[[a-z]]
— Where a and z are single characters or character escapes. Matches any character in the range between a and z (inclusive), just like a normal [character class range].
Example
[a-z&&[^d-q]]
Is equivalent to:
[a-cr-z]
Engines
Engine | Supported |
---|---|
Perl | ✔ |
PCRE | ❌ |
Boost.Regex | ❌ |
.NET | ❌ |
Oniguruma | ✔ |
Hyperscan | ❌ |
ICU | ✔ |
Glib/GRegex | ❌ |
ECMAScript | ❌ |
See Also
- Character Classes
- Posix Character Classes
- Negated Posix Character Classes
- Collating Elements
- Equivalence Classes
- Character Class Escapes
- Line Endings Escape
- Character Property Escapes
- Character Class Intersection
- Character Class Union
- Character Class Subtraction
- Character Class Symmetric Difference
- Character Class Complement