Micro Focus QTP (UFT) Forums
How to Check Alphanumeric's from webtable - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: How to Check Alphanumeric's from webtable (/Thread-How-to-Check-Alphanumeric-s-from-webtable)



How to Check Alphanumeric's from webtable - branjitk - 06-28-2012

Hi all,

Good Morning to all.

I am having one doubt, For checking a condition from web table cell contains alphanumeric data. In that cell some part is constant and remaining part is changing. How to check this type of condition.

Cell values: To : Islamabad (ISB)
To : Karachi (KHI)
To : Peshawar (PEW)

Here, i done below ways to check the condition,but it is not working.
Code:
If var = "To : " & "[A-Za-z()]" Then
End If.
and
If var = "To : " + "[A-Za-z()]" Then
End If.

Regards,
Ranjit B


RE: How to Check Alphanumeric's from webtable - supputuri - 06-28-2012

Please check the below code
Code:
myvalue = "Karachi (KHI1-)"

Set regexp = New RegExp
regexp.Pattern =  "[^\w\(\)\s]"
regexp.Global = True
regexp.IgnoreCase = True
set Matches = regexp.Execute(myvalue)
msgbox Matches.Count
If Matches.Count = 0 Then
    msgbox "input contains only alphanumerics and spl chars ()"
else
    For Each Match in Matches
        msgbox Match
    Next
End If