Micro Focus QTP (UFT) Forums
How to chach no of characters in Textbox with the use of Reguler Exp. - 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: How to chach no of characters in Textbox with the use of Reguler Exp. (/Thread-How-to-chach-no-of-characters-in-Textbox-with-the-use-of-Reguler-Exp)



How to chach no of characters in Textbox with the use of Reguler Exp. - chetan-24 - 09-27-2008

Hi,
Chetan Here
i have recently joined.
i want to know that how we count number of characters in textbox.
There is one validation in my application
Validation:
The textbox contains minimum 2 charactors
Please help me


RE: How to chach no of characters in Textbox with the use of Reguler Exp. - kishoreinchennai - 09-30-2008

1)You can use the len function which will return the length of the string pass the textbox value to this function.

2)
Code:
objRegExpr.Pattern = "[A-Za-z0-9]{2,}"

I am not sure whether you can have Special characters like _ etc.The above regex will work
for a text box which contains alphabets and numbers.

Regards

Regards


RE: How to chach no of characters in Textbox with the use of Reguler Exp. - chetan-24 - 09-30-2008

Thanks Kishore
i think it may work for me.