Sub FindRegex($source As String, $regex As String, ByRef $startPos As Integer, ByRef $length As Integer) As Boolean
|
Searches in $source for the first occurrence of $regex. $regex is a Regular Expression.
FindRegex is case-insensitive. The first character in $source has the position 1. If $regex is found, FindRegex returns TRUE.
Parameters
• | $source ... String expression sought. |
• | $regex ... Regular expression being searched. |
• | $startPos ... Index of first occurrence. |
• | $length ... Length of found String. |
Example:
Dim $s, $iStart, $iLen
$s = "this is number 13 or a text"
If FindRegex($s, "number \d+", $iStart, $iLen) Then
' returns iStart = 9, iLen = 9
End If
|
|