Using Regular Expressions Metacharacters with .net – POSIX Character Classes
The POSIX or "Portable Operating System Interface for Unix" is the collective name of a family of related standards specified by the IEEE to define the application programming interface (API), along with shell and utilities interfaces for software compatible with variants of the Unix operating system, although the standard can apply to any operating system. Originally, the name stood for IEEE Std 1003.1-1988, which, as the name suggests, was released in 1988. The family of POSIX standards is formally designated as IEEE 1003 and the international standard name is ISO/IEC 9945. The standards emerged from a project that began circa 1985. Formerly known as IEEE-IX, the term POSIX was suggested by Richard Stallman in response to an IEEE request for a memorable name.
Caution..??
JavaScript does not support the use of POSIX character classes in regular expressions. All 12 POSIX classes enumerated here are generally supported in any implementation that supports POSIX. However, there may be subtle variances from the preceding descriptions.
The POSIX syntax is quite different from the metacharacters seen thus far, the POSIX standard calls a bracket expression. POSIX uses the term "character class" for a special feature used within a bracket expression[] that we might consider to be the precursor to Unicode’s character properties. Repeated the character set [0-9A-Fa-f] six times represent a hexadecimal(base 16) number. Here each [0-9A-Fa-f] has been replaced by [[:xdigit:]]. The result is the same.
Below table well explain us with the usability of each metacharacter for POSIX Character Classes.
| Table 1: Regular Expressions Metacharacters for POSIX Character Classes | |
| meta-character | Definition ( or Use) |
| [:alnum:] | alphabetic characters and numeric character. Any letter or digit, (same as [a-zA-Z0-9]) |
| [:alpha:] | alphabetic characters. Any letter (same as [a-zA-Z]) |
| [:blank:] | space and/or tab (same as [\t ]) |
| [:cntrl:] | ASCII control characters (ASCII 0 through 31 and 127) |
| [:digit:] | digits (same as [0-9]) |
| [:graph:] | non-blank characters (not spaces, control characters, or the like). Same as [:print:] but excludes space |
| [:lower:] | lowercase alphabetics (same as [a-z]) |
| [:print:] | like [:graph:] any printable character, but includes the space character |
| [:punct:] | Punctuation characters. Any character that is neither in [:alnum:] nor [:cntrl:] |
| [:space:] | all whitespace characters ([:blank:], newline, carriage return, same as [\f\n\r\t\v ]) |
| [:upper:] | uppercase alphabetics (same as [A-Z]) |
| [:xdigit:] | digits allowed in a hexadecimal number (i.e., 0-9a-fA-F) |





[...] Using Regular Expressions Metacharacters with .net – POSIX Character Classes [...]