Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 9.4   9.5   10.0   10.1   10.2   10.3   10.4   10.5   11.0   11.1    Statistic    FMM    Blog  

RegEx.Extract

Extracts found text.

Component Version macOS Windows Linux Server FileMaker iOS SDK
RegEx 11.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "RegEx.Extract"; Text; Pattern; Rewrite { ; Options } )   More

Parameters

Parameter Description Example Flags
Text The text to use. "hello world"
Pattern The pattern to use. "l+"
Rewrite The output pattern. "\1\1"
Options The PCRE options.
Can be given as text or number.
0 Optional

Result

Returns OK or error.

Description

Extracts found text.
Similar like RegEx.Replace, but returns only the found text given to the pattern for output.

Examples

Extract phone number:

MBS( "RegEx.Extract"; "Call us at 01234/5678-90 to speak to sales."; "([0-9][0-9/\\-]+[0-9])"; "\1"; 1 )

Example result: 01234/5678-90

See also

Release notes

  • Version 11.1
    • Added RegEx.Extract function.

Created 19th February 2021, last changed 19th February 2021


RegEx.Execute   -   RegEx.FindMatches

Feedback: Report problem or ask question.




Links
MBS Xojo PDF Plugins

Start Chat