![]() |
PIP 5.5.3
Platform-Independent Primitives
|
Regular expression class Class for working with regular expressions. More...
#include <piregularexpression.h>
Classes | |
| class | Matcher |
| Class containing regular expression match results. More... | |
Public Types | |
| enum | Option { None = 0x0 , CaseInsensitive = 0x01 , Singleline = 0x02 , Multiline = 0x04 , InvertedGreediness = 0x08 , Extended = 0x10 } |
| Options for regular expression matching behavior. More... | |
| typedef PIFlags< Option > | Options |
| Combination of regular expression options. | |
Public Member Functions | |
| PIRegularExpression (const PIString &pattern={}, Options opt=None) | |
| Creates regular expression with given pattern and options. More... | |
| PIRegularExpression (const PIRegularExpression &o) | |
| Creates copy of regular expression. More... | |
| PIRegularExpression & | operator= (const PIRegularExpression &o) |
| Assigns regular expression. More... | |
| ~PIRegularExpression () | |
| Destroys regular expression object. | |
| PIString | pattern () const |
| Returns regular expression pattern. | |
| Options | options () const |
| Returns regular expression options. | |
| void | setPattern (const PIString &pattern) |
| Sets regular expression pattern. More... | |
| void | setPattern (const PIString &pattern, Options opt) |
| Sets regular expression pattern and options. More... | |
| bool | isValid () const |
| Returns true if regular expression is valid. | |
| bool | isNotValid () const |
| Returns true if regular expression is not valid. | |
| PIString | errorString () const |
| Returns error description if pattern is invalid. | |
| int | errorPosition () const |
| Returns position of error in pattern. | |
| int | captureGroupsCount () const |
| Gets the number of capture groups in the pattern. | |
| PIStringList | captureGroupNames () const |
| Gets the list of named capture groups. | |
| PIString | captureGroupName (int index) const |
| Gets the name of capture group by index. More... | |
| int | captureGroupIndex (const PIString &gname) const |
| Gets the index of named capture group. More... | |
| Matcher | match (const PIString &subject, size_t offset=0) const |
| Matches regular expression against deep copy of subject string. More... | |
| Matcher | match (PIString &subject, size_t offset=0) const |
| Matches regular expression against subject string. More... | |
| Matcher | match (PIString &&subject, size_t offset=0) const |
| Matches regular expression against subject string. More... | |
| Matcher | matchIterator (const PIString &subject, size_t offset=0) const |
| Prepere match regular expression against deep copy of subject string. More... | |
| Matcher | matchIterator (PIString &subject, size_t offset=0) const |
| Prepere match regular expression against subject string. More... | |
| Matcher | matchIterator (PIString &&subject, size_t offset=0) const |
| Prepere match regular expression against subject string. More... | |
Static Public Member Functions | |
| static PIRegularExpression | fromGlob (const PIString &pattern, Options opt=None) |
| Creates regular expression from glob pattern. More... | |
| static PIRegularExpression | fromPOSIX (const PIString &pattern, Options opt=None) |
| Creates regular expression from POSIX pattern. More... | |
Regular expression class Class for working with regular expressions.
Creates regular expression with given pattern and options.
| pattern | Regular expression pattern |
| opt | Matching options |
| PIRegularExpression::PIRegularExpression | ( | const PIRegularExpression & | o | ) |
Creates copy of regular expression.
| o | Source regular expression |
| PIRegularExpression & PIRegularExpression::operator= | ( | const PIRegularExpression & | o | ) |
Assigns regular expression.
| o | Source regular expression |
| void PIRegularExpression::setPattern | ( | const PIString & | pattern | ) |
Sets regular expression pattern.
| pattern | New pattern |
Sets regular expression pattern and options.
| pattern | New pattern |
| opt | New options |
| PIString PIRegularExpression::captureGroupName | ( | int | index | ) | const |
Gets the name of capture group by index.
| index | Group index |
| int PIRegularExpression::captureGroupIndex | ( | const PIString & | gname | ) | const |
Gets the index of named capture group.
| gname | Group name |
| PIRegularExpression::Matcher PIRegularExpression::match | ( | const PIString & | subject, |
| size_t | offset = 0 |
||
| ) | const |
Matches regular expression against deep copy of subject string.
| subject | String to match against |
| offset | Starting position for matching |
| PIRegularExpression::Matcher PIRegularExpression::match | ( | PIString & | subject, |
| size_t | offset = 0 |
||
| ) | const |
Matches regular expression against subject string.
| subject | String to match against |
| offset | Starting position for matching |
| PIRegularExpression::Matcher PIRegularExpression::match | ( | PIString && | subject, |
| size_t | offset = 0 |
||
| ) | const |
Matches regular expression against subject string.
| subject | String to match against |
| offset | Starting position for matching |
| PIRegularExpression::Matcher PIRegularExpression::matchIterator | ( | const PIString & | subject, |
| size_t | offset = 0 |
||
| ) | const |
Prepere match regular expression against deep copy of subject string.
| subject | String to match against |
| offset | Starting position for matching |
| PIRegularExpression::Matcher PIRegularExpression::matchIterator | ( | PIString & | subject, |
| size_t | offset = 0 |
||
| ) | const |
Prepere match regular expression against subject string.
| subject | String to match against |
| offset | Starting position for matching |
| PIRegularExpression::Matcher PIRegularExpression::matchIterator | ( | PIString && | subject, |
| size_t | offset = 0 |
||
| ) | const |
Prepere match regular expression against subject string.
| subject | String to match against |
| offset | Starting position for matching |
|
static |
Creates regular expression from glob pattern.
| pattern | Glob pattern |
| opt | Matching options |
|
static |
Creates regular expression from POSIX pattern.
| pattern | POSIX pattern |
| opt | Matching options |