Compiled Perl-compatible regular expression, including named capture groups.
More...
#include <OpenMS/DATASTRUCTURES/RegularExpression.h>
|
| | RegularExpression () |
| | Default constructor: holds no pattern (empty() is true) and matches like the pattern "".
|
| |
| | RegularExpression (const std::string &pattern) |
| | Compiles pattern (Perl syntax)
|
| |
| void | assign (const std::string &pattern) |
| | Replaces the expression by pattern; copies made earlier keep the old one.
|
| |
| std::string | str () const |
| | The pattern this expression was compiled from; "" if it holds none.
|
| |
| bool | empty () const |
| | True only if no pattern was set; a compiled "" is not empty.
|
| |
| bool | search (const std::string &text, std::string *first_match=nullptr) const |
| | Search text, optionally returning the first complete match.
|
| |
|
| std::shared_ptr< const Impl > | impl_ |
| |
Compiled Perl-compatible regular expression, including named capture groups.
Copies share immutable compiled state. assign() replaces only this expression. The regex engine and its headers are private to OpenMS.
◆ RegularExpression() [1/2]
Default constructor: holds no pattern (empty() is true) and matches like the pattern "".
◆ RegularExpression() [2/2]
Compiles pattern (Perl syntax)
- Exceptions
-
| std::runtime_error | if pattern is not a valid regular expression |
◆ assign()
| void assign |
( |
const std::string & |
pattern | ) |
|
Replaces the expression by pattern; copies made earlier keep the old one.
- Exceptions
-
| std::runtime_error | if pattern is not a valid regular expression |
◆ empty()
True only if no pattern was set; a compiled "" is not empty.
◆ search()
| bool search |
( |
const std::string & |
text, |
|
|
std::string * |
first_match = nullptr |
|
) |
| const |
◆ str()
| std::string str |
( |
| ) |
const |
The pattern this expression was compiled from; "" if it holds none.
◆ Internal::RegularExpressionAccess
| friend struct Internal::RegularExpressionAccess |
|
friend |
◆ impl_
| std::shared_ptr<const Impl> impl_ |
|
private |