MatchRegularExpression()

语法

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

参数

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

返回值

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

示例

  ; 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

参阅

CreateRegularExpression()

已支持操作系统

所有

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