9.3. Syntax Identifier

9.3.1. Rationale

Identifiers specifies what to find. They are also called Character Classes.

9.3.2. Numeric

  • \d - digit

  • \D - anything but digit

9.3.3. String

  • \w - any unicode alphabet character (lower or upper, also with diacritics (i.e. ąćęłńóśżź...), numbers and underscores

  • \W - anything but any unicode alphabet character (i.e. whitespace, dots, comas, dashes)

9.3.4. Whitespaces

  • \s - whitespace (space, tab, newline, non-breaking space)

  • \S - anything but whitespace

  • \n - newline

  • \r\n - windows newline

  • \r - carriage return

  • \b - backspace

  • \t - tab

  • \v - vertical space

  • \f - form feed

9.3.5. Anchors

  • \b - word boundary

  • \B - anything but word boundary

Examples:

  • \babc\b - performs a "whole words only" search

  • \Babc\B - pattern is fully surrounded by word characters