12-13-2011, 04:35 PM
Hi Sures,
Can you try this..
'The below is the patter which can be used in your case
'\d{1,} - means any digit which will occur atleast once and may appear n times
'[a-z]{2,} - any two digit character to n length characted
'$ - indicates the end of the string
let me know if it works.
Regards,
Ankesh
Can you try this..
Code:
strText="Test_101UP_abcde_UNIT"
Set RegEx = CreateObject("VBScript.RegExp")
'\d{1,} - means any digit which will occur atleast once and may appear n times
'[a-z]{2,} - any two digit character to n length characted
'$ - indicates the end of the string
Code:
RegEx.Pattern ="^Test_\d{1,}UP_[a-z]{2,}_UNIT$"
result=RegEx.Test(strText)
If result=True Then
msgbox "Pass"
Else
msgbox "Fail"
End If
Set RegEx=Nothing
let me know if it works.
Regards,
Ankesh