QTP Forums

Full Version: Regular Expression for sentence
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
Can anyone help me to write the regular expression for

<html> Container <font color = red><B>20DCTNB1</B> </font> does not exist in the inventory. Considered as a Dummy Container </html>

==> 20DCTNB1 changes very often
I tried
<html> Container <font color = red><B>\w[A-Za-z0-9]{8}</B> </font> does not exist in the inventory. Considered as a Dummy Container </html>

<html> Container <font color = red><B>".*TN*\."</B> </font> does not exist in the inventory. Considered as a Dummy Container </html>


but not working.
Anyone help me.
Regds,
samy G
Hi Try this out

vText = "20DCTNB1"

Set oRegExp = New RegExp
oRegExp.IgnoreCase = True
oRegExp.Global=False
oRegExp.Pattern="^\w{4}TN\w{2}"

Msgbox oRegExp.Test(vText)
Dear Frds,
Set dc= description.Create()
dc("Label").Value= ".*does not exist in the inventory.*"

The above dp working. But i have query how can i use in Check point. Plz help me...

Regds,
Samy G
hey Sammy
Please open a new thread for your query.
Reference URL's