Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help Again with regular expression
#7
@ Jinnah,

You can not simply compare the regular expression using conditional statement.

Let me explain it to you.

Below are the basic steps that you need to follow.

1. You need to create an object of VbScript.RegExp
2. Assign the pattern you want to test.
3. Pass your string and check the result. It only returns true/False for successful/Unsuccessful results.

Let me give you one example.

Code:
Set RegEx = CreateObject("VBScript.RegExp") RegEx.Pattern = "#[0-9]+" //This is the pattern tht you need to write, here it is for "#8" blnResult=RegEx.Test(strText) ' str text is the string that you want to check. as per your example here it is #8 If blnResult=True Then 'Pass ' Your reporter event Else 'Fail 'Your reporter End If Set RegEx=Nothing

Let me know if you need more help.

Regards,
Ankesh
Reply


Messages In This Thread
Help Again with regular expression - by jinnah - 09-12-2012, 08:15 AM
RE: Help Again with regular expression - by Ankesh - 09-24-2012, 06:30 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Need Any digit in xpath path using Regular expression Priyam 1 4,348 10-05-2016, 11:05 AM
Last Post: Ankur
  Regular expression to read two words in lowercase, uppercase and with and without spa sarahq49 1 4,038 04-09-2015, 01:56 AM
Last Post: sarahq49
  Regular expression and script optimisation Padmavathy 1 4,659 03-30-2015, 11:46 AM
Last Post: supputuri
  Regular expression in descriptive programming testernc 1 17,346 12-08-2014, 06:38 PM
Last Post: anshika.agarwal
  need a regular expression. anu05446 0 3,671 11-26-2014, 03:00 PM
Last Post: anu05446

Forum Jump:


Users browsing this thread: 1 Guest(s)