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.Substring
Queries a substring.
| 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 |
| Index | The index for the substring. | 0 |
Result
Returns text or error.
Description
Queries a substring.Index 0 gives whole match and index from 1 to RegEx.CaptureCount gives substrings matched.
Examples
Find seller ID in an URL:
Let ([
pattern = "^http.*\?.*&seller=(.*)$";
text = "https://www.example.com.com/gp/aag/main/ref=olp_merch_name_2?ie=UTF8&astn=B8J070KLDO&isFulfilled=1&seller=A2XKMLD9HIY1T";
regex = MBS( "RegEx.Compile"; pattern; 512+1 );
r = MBS( "RegEx.Execute"; regex; text; 0 );
r = MBS( "RegEx.Substring"; regex; 1 );
f = MBS( "RegEx.Free"; regex )
] ; r )
See also
Example Databases
Created 26th October 2014, last changed 9th June 2017
RegEx.Study - RegEx.SubstringList
Feedback: Report problem or ask question.
Links
MBS Xojo tutorial videos