Home > comp > gb.pcre > regexp 
 fr de es it nl pl pt pt_BR mk sq ca hu cs tr ar fa id vi ko ja ru zh zh_TW eo
Previous  Next  Edit  Rename  Undo  Refresh  Search  Administration  
Documentation
History
 
Regexp (gb.pcre)
This class represents a regular expression, with which you can perform matches against various strings and retrieve submatches (those parts of the subject string that match parenthesized expressions).

Symbols
This class is creatable.

Constants 
Anchored  BadMagic  BadOption  BadUTF8  BadUTF8Offset  Callout  Caseless  DollarEndOnly  DotAll  Extended  Extra  MatchLimit  MultiLine  NoAutoCapture  NoMatch  NoMemory  NoSubstring  NoUTF8Check  NotBOL  NotEOL  NotEmpty  Null  UTF8  Ungreedy  UnknownNode   
Properties  Methods 
Offset  Pattern  SubMatches  Subject  Text    Compile  Exec   

Example

For example, given the regular expression:

brown (\S+)

and subject string:

The quick brown fox slyly jumped over the lazy dog

your Regexp object's Text property would be:

brown fox

and its Submatches[1].Text property would be:

fox

This is just a simple example of what regular expressions can do for you when parsing textual input; they are a very powerful tool. For example, the following regular expression will extract valid email addresses for you:

(?i)\b[a-z0-9._%\-]+@[a-z0-9._%\-]+\.[A-Z]{2,4}\b

See also

PCRE Pattern Syntax