Page 1 of 1

Regular Expression

Posted: Wed Jan 14, 2015 4:13 pm
by NewLearner
//cell[@Accname=' 0006000 User 14/01/2015 15:03 109']

please let me know how to handle this in regular expression, date and time keep changing and 109 is the order number this also keep change...but order number stored in module variable $orderNumber.


Thanks in Advance

Re: Regular Expression

Posted: Wed Jan 14, 2015 4:15 pm
by NewLearner
//cell[@Accname=' 0006000 User 14/01/2015 15:03 109']

please let me know how to handle this in regular expression, date and time keep changing and 109 is the order number this also keep change...but order number stored in module variable $orderNumber.

Validation in mainly for ordernumber....what ever time stamp is ok

Thanks in Advance

Re: Regular Expression

Posted: Wed Jan 14, 2015 4:50 pm
by krstcs
How about variablizing the order number and using regex for the rest, like this:

Code: Select all

//cell[@Accname~' 0006000 User .* .* ' + $orderNumber]
Since you don't care about the date, you can use the ".*" notation to say "anything can be in this location".

Just remember to only replace the date and time strings with the .* as it doesn't always work right with whitespace.

You could also do the full regex pattern for the date and time:

Code: Select all

//cell[@Accname~' 0006000 User [0-3][0-9]/[0-1][0-9]/[0-9][0-9][0-9][0-9] [0-2][0-9]\:[0-5][0-9] ' + $orderNumber]