MatchRegularExpression()

Syntax

Result = MatchRegularExpression(#RegularExpression, String$)
Description
Tests the string against the #RegularExpression.

Parameters

#RegularExpression The regular expression to use.
String$ The string to apply the regular expression on.

Return value

Returns nonzero if the string matches the regular expression, returns zero otherwise.

Example

  ; This expression will match every word of 3 letter which begin by a lower case letter,
  ; followed with the character 'b' and which ends with an uppercase letter. ex: abC
  ;    
  If CreateRegularExpression(0, "[a-z]b[A-Z]")
    If MatchRegularExpression(0, "abC ABc zbA abc")
      Debug "The string match !"
    Else
      Debug "No pattern found in the string"
    EndIf
  Else
    Debug RegularExpressionError()
  EndIf

See Also

CreateRegularExpression()

Supported OS

All

<- IsRegularExpression() - RegularExpression Index - RegularExpressionError() ->