Micro Focus QTP (UFT) Forums
Regular Expression for sentence - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Regular Expressions (https://www.learnqtp.com/forums/Forum-UFT-QTP-Regular-Expressions)
+--- Thread: Regular Expression for sentence (/Thread-Regular-Expression-for-sentence)



Regular Expression for sentence - gadaikalam - 05-25-2009

Hi,
Can anyone help me to write the regular expression for

Code:
<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
Code:
<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>

Code:
<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


RE: Regular Expression for sentence - manojith1984 - 05-27-2009

Hi Try this out

Code:
vText = "20DCTNB1"

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

Msgbox oRegExp.Test(vText)



RE: Regular Expression for sentence - gadaikalam - 10-06-2009

Dear Frds,
Code:
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


RE: Regular Expression for sentence - Saket - 10-06-2009

hey Sammy
Please open a new thread for your query.