Syntax
RegExMatch <string> <regex> [MatchCase]Description
Return True if a string contains a substring that matches the provided regular expression.Parameters
<string>
- The string to search.
<regex>
- The regular expression to search for.
MatchCase
- Optional. If this keyword is present the string comparison is case-sensitive.
Remarks
See Regular Expressions for information on regular expression support in Phantom for Windows.The following PhantomScript statements also accept regular expressions:
To match verify that the entire string matches the regular expression, prefix the regular expression with ^ and end it with $. This specifies that the string must start with a matching string and end with a matching string.
RegExGrep
RegExReplace
RegExSplitExample
ReadFile infile fileline
If RegExMatch fileline "<.*>.*</.*>" Then
Gosub ExtractXML
EndIfThe above code fragment executes the HandleTax subroutine if the line read from the file is an XML tag such as <class>XCLASS</class>.