Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 7.0   7.1   7.2   7.3   7.4   7.5   8.0   8.1   8.2   8.3    Statistic  

RegEx.CaptureCount

Queries number of captured sub patterns.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
RegEx 4.4 Yes Yes Yes Yes Yes

MBS( "RegEx.CaptureCount"; RegExRef )

Parameters

Parameter Description Example value
RegExRef The reference number for the regular expression returned from RegEx.Compile. $regex

Result

Returns number or error.

Description

Queries number of captured sub patterns.

Examples

Run query:

Set Variable [ $Pattern ; Value: "H(.*)o (.)or(..)" ]
Set Variable [ $Text ; Value: "Hello World Test" ]
# Compile
Set Variable [ $Regex ; Value: MBS("RegEx.Compile"; $Pattern; "CaseLess") ]
If [ MBS("isError") ]
    Show Custom Dialog [ $Regex ]
    Exit Script [ Text Result: ]
End If
Set Variable [ $ExecuteResult ; Value: MBS("RegEx.Execute"; $RegEx; $Text; "") ]
If [ MBS("IsError") = 0 ]
    Show Custom Dialog [ "Captures" ; MBS("RegEx.CaptureCount"; $RegEx) & " captures" ]
End If
# free last
Set Variable [ $r ; Value: MBS("RegEx.Free"; $RegEx) ]

See also

Example Databases


RSA.Verify   -   RegEx.Compile

Feedback: Report problem or ask question.




Links
MBS FileMaker Plugins