Multi-character Escapes

Literal characters match a specific character. Multi-character escapes match any of a set of characters. The multi-character escapes understood by Rx are:

        \s      -- spaces
        \i      -- first character of a "name"
        \c      -- subsequent character of a "name"
        \d      -- digits
        \w      -- word characters

\s matches a single space, tab, newline, or carriage return.

The set of characters valid as the first or subsequent characters in a name (matched by \i and \c respectively) are as defined in XML.

The set of characters matched by \d is as defined in XML and includes most Unicode characters with general category Nd .

The set of characters matched by \w includes all characters which are valid in an XML document except those with a general category in class P (punctuation), Z (separators), and C (other, such as control characters and unassigned code points).

Each of the multi-character escapes can be negated by writing it as a capital letter:

        \S      -- non-spaces
        \I      -- not the first character of a "name"
        \C      -- not a subsequent character of a "name"
        \D      -- non-digits
        \W      -- non-word characters

For tech news today and latest technology in computer. Please visit www.regexps.com.