Express|vbscript|express|vbscript
REGULAR EXPRESSION in VBSCRIPT
Object REGEXP is used to create and execute regular expression
Ex.
Code:
strtarget= "Test testing tested attest late Start"
Set objregexp= New RegExp ' Create a regular expression
objregexp.pattern= "test*" ' Set the search pattern
Objregexp.ignorecase=false ' Set the case sensitivity
Objregexp.global=true ' Set the scope
Set Colmatches=objregexp.execute (strtarget) ' Execute ' Search
For each Match in Colmathes ' Iterate the Colmatches collection
Response.Write "Match found at position" & Match.firstindex & "."
Response.Write "Matched value is '" & Match.value & "',<br>"
Next
Tested Result:
Match found at position 0. Matched value is ' test '.
Match found at position 5. Matched value is ' test '.
Match found at position 13. Matched value is ' test '.
Match found at position 22. Matched value is ' test '.