lib_mysqludf_preg is a library of mysql UDFs (user-defined-functions) that provide access to the PCRE (perl compatible-regular-expressions) library for pattern matching. The PCRE library is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl 5. This syntax can often handle more complex expressions and capturing than standard regular expression implementations.
lib_mysqludf_preg currently provides the following functions:
- PREG_RLIKE( pattern , subject )
- test whether subject matches pattern, which is a perl compatible regular expression.
- PREG_CAPTURE(pattern, subject [, capture-group] [, occurence] )
- capture a named or numeric parenthesized subexpression from a pcre pattern. Capture from a specific match of the regex or the first match is occurence not specified.
- PREG_CHECK( pattern )
- test whether the given pattern is a valid perl compatible regular expression.
- PREG_POSITION(pattern, subject [, capture-group] [, occurence] )
- get the position in subject of a named or numeric parenthesized subexpression from a pcre pattern. Capture from a specific match of the regex or the first match if occurence not specified.
- PREG_REPLACE(pattern, replacement, subject [ ,limit ] )
- perform a regular expression search and replace using a PCRE pattern.
- obtain information about the currently installed version of lib_mysqludf_preg.