Micro Focus QTP (UFT) Forums

Full Version: How to chach no of characters in Textbox with the use of Reguler Exp.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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
Thanks Kishore
i think it may work for me.