Home | Modules | Class Hierarchy | Alphabetical List | Compound List | Related Pages

# CRegExp Class Reference
[Regular Expressions]

## Detailed Description

Regular Expression compiler and matcher.

Colorer regular expressions library cregexp.

1. Features.

1.1. Colorer Unicode classes.
  - Unicode Consortium regexp level 1 support. All characters are treated as independent 16-bit units. The result of RE is independent of current locale.
  - Unicode syntax extensions:
    - Unicode general category char class:
      - [{L}{Nd}] - all letters and decimal digits,
      - [{ALL}] - as '.',
      - [{ASSIGNED}] - all assigned unicode characters,
      - [{UNASSIGNED}] - all unassigned unicode characters.
    - Char classes substraction unicode extension:
      - [{ASSIGNED}-[{Lu}]-[{Ll}]] - all assigned characters except,
      - upper and lower case characters.
    - Char classes connection syntax:
      - [{Lu}[{Ll}]] - upper and lower case characters.
    - Char classes intersection syntax:
      - [{ALL}&&[{L}]] - only Letter characters.
    - Character reference syntax: \x{2028} \x0A as in Perl.
    - Unicode form \u2028 is unused (\u - upper case char).

1.2. Extensions.
  - Bracket extensions:
    - (?{name} pattern ) - named bracket,
    - \p{name} - named bracket reference.
    - (?{} pattern ) - no capturing bracket as (?: pattern ) in Perl.
  - Look Ahead/Backward:
    - pattern?= as Perl's (?=pattern)
    - pattern?! as Perl's (?!pattern)
    - pattern?N - N symbols backward look for pattern
    - pattern?~N - N symbols backward look for no pattern
  - Colorer library extensions:
    - \m \M - sets new start and end of zero(default) bracket.
    - \yN \YN \y{name} \Y{name} - back reference into another RE's bracket.

1.3. Perl compatibility.
  - Modifiers //ismx
  - \ p{name} - back reference to named bracket (but not named property as in Perl!)
  - No POSIX character classes support.

2. Dislikes:

2.1. According to Unicode RE level 1 support:
  - No surrogate symbols support,
  - No string length changes on case mappings (only 1 <-> 1 mappings),

2.2. Algorithmic problems:
  - Stack recursion implementation.

## Public Member Functions
| CRegExp ()
| Empty constructor.
| CRegExp (const String *text)
| Constructs regular expression and compile it with `text` pattern.
bool | isOk ()
| Is compilied RE well-formed.
EError | getError ()
| Returns information about RE compilation error.
bool | setPositionMoves (bool moves)
| Tells RE parser, that it must make moves on tested string while RE matching.
int | getBracketNo (const String *brname)
| Returns count of named brackets.
String * | getBracketName (int no)
| Returns named bracked name by it's index.
bool | setBackRE (CRegExp *bkre)
bool | setBackTrace (const String *str, SMatches *trace)
| Changes RE object, used for backreferences with named {} {} operators.
bool | getBackTrace (const String **str, SMatches **trace)
| Returns current RE object, used for backreferences with operators.
bool | setRE (const String *re)
| Compiles specified regular expression and drops all previous structures.
bool | parse (const String *str, SMatches *mtch)
| Runs RE parser against input string `str`.
bool | parse (const String *str, int pos, int eol, SMatches *mtch, int soscheme=0, int moves=-1)
| Runs RE parser against input string `str`.

## Constructor & Destructor Documentation

CRegExp::CRegExp | ( |  | ) |

| Empty constructor. No RE tree is builded with this constructor. Use setRE method to change pattern.

Colorer-take5 Library. Copyright © 1999-2006 Igor Russkih.
Generated at Fri Nov 24 17:13:12 2006 by doxygen 1.4.6.