MathTop

reg_match 函数

判断正则表达式是否匹配文本。

语法

  • StringTools:-RegMatch(pattern, text)
  • RegMatch(pattern, text)
  • reg_match(pattern, text)

参数与选项

pattern正则表达式模式。
text要测试的文本。

示例

  1. 模式匹配StringTools:-RegMatch('^[A-Z]+ , 'ABC')返回 true。