Next: Capturing groups, Previous: Compile, Up: Functions [Contents][Index]
The functions below return match descriptor, i.e. a positive number that can be used to retrieve further information about the match (see Capturing groups). On failure (string doesn’t match the oregular expression), they return 0.
If the supplied match descriptor is not valid, these functions will
raise the e_range
exception.
First argument is regex descriptor returned by previous call to
pcre_compile
.
The function matches subject against the regular expression referred to by rx. Returns match descriptor on success and 0 on failure.
Compiles rs into a regular expression and matches string subject against it. Returns match descriptor on success and 0 on failure.
When no longer used, the match descriptor should be freed:
Frees the resources allocated for the match descriptor mh and returns it to the pool for eventual re-use.
The two functions below return a boolean value: true (1) if the string matches and false (0) if it doesn’t.
First argument is regex descriptor returned by a previous call to
pcre_compile
.
Returns true if string matches that regular expression and false otherwise.
Compiles rs into a regular expression and matches string subject against it. Returns true if the match is found and false otherwise.