wiki:ICgrepSyntax

Version 2 (modified by cameron, 5 years ago) (diff)

--

ICgrep Syntax

ICgrep supports an extensive regular expression syntax.

Regular Expression Metacharacters

\a Match a BELL, \u0007
\b Zero-width match at a word boundary: transition between word (\w) and non-word (\W) characters
\B Zero-width match if the current position is not a word boundary.
\cX Match a control-X character.
\d Match any character with the Unicode General Category of Nd (Number, Decimal Digit.)
\D Match any character that is not a decimal digit.
\e Match an ESCAPE, \u001B.
\f Match a FORM FEED, \u000C.
\p{Unicode property expression} Match any character with the specified Unicode property.
\P{Unicode property expression} Match any character not having the specified Unicode property.
\s Match a white space character.
\S Match a non-white space character.
\t Match a HORIZONTAL TABULATION, \u0009.
\uhhhh Match the character with the hex codepoint value hhhh.
\Uhhhhhhhh Match the character with the 8-digit hex codepoint value hhhhhhhh.
\u{hhh} Match the character with the hex code point value hhh (1-6 hex digits)
\w Match a word character.
\W Match a non-word character.
\x{hhh} Match the character with the hex code point value hhh (1-6 hex digits)
\xhh Match the character with two digit hex value hh
\0ooo Match the character with the octal codepoint value ooo.
[class] Match one character from the character class expression
. Match any legal character.
Zero-width match at the beginning of a line.
$ Zero-width match at the end of a line.
\ Escape the following metacharacter, match it literally.