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.3
9.4
9.5
10.0
10.1
10.2
10.3
10.4
10.5
10.6
Statistic
FMM
Blog
RegEx.Results
Queries the result from execute.
| Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
| RegEx | 4.4 | Yes | Yes | Yes | Yes | Yes |
Parameters
| Parameter | Description | Example |
|---|---|---|
| RegExRef | The reference number for the regular expression returned from RegEx.Compile. | $regex |
Result
Returns OK or error.
Description
Queries the result from execute.The result are offsets into the text to search. Two for the whole match followed by 2 for each sub pattern.
Examples
Loop and find all matches for pattern:
Set Variable [ $pattern ; Value: "(USt\-?ID:?|USt\-?IdNR\.?:?|Umsatzsteuer\-?ID:?|VAT\-?ID:?)[\s]?(DE)[\s]?([0-9]{9})" ]
Set Variable [ $ExecuteOptions ; Value: 0 ]
Set Variable [ $CompileOptions ; Value: "caseless" ]
Set Variable [ $regex ; Value: MBS("RegEx.Compile"; $Pattern; $CompileOptions) ]
Set Variable [ $offset ; Value: 0 ]
Loop
Set Variable [ $r ; Value: MBS("RegEx.Execute"; $regex; RegEx::Text; $ExecuteOptions; $offset) ]
Exit Loop If [ $r < 4 ]
Set Variable [ $s1 ; Value: MBS("RegEx.Substring"; $RegEx; 1) ]
Set Variable [ $s2 ; Value: MBS("RegEx.Substring"; $RegEx; 2) ]
Set Variable [ $s3 ; Value: MBS("RegEx.Substring"; $RegEx; 3) ]
Show Custom Dialog [ $s1 & ¶ & $s2 & ¶ & $s3 ]
Exit Loop If [ MBS("IsError") ]
Set Variable [ $offset ; $offset + Value: GetAsNumber(GetValue(MBS("RegEx.Results"; $regex); 2)) ]
End Loop
Set Variable [ $r ; Value: MBS("RegEx.Free"; $RegEx) ]
See also
Created 26th October 2014, last changed 29th June 2018
Feedback: Report problem or ask question.
Links
MBS FileMaker blog