How to retrieve alpha bate from the alphanumeric string with
special character.

Answer Posted / uday

If you are looking to retrieve only alphabet string from the
input, use below code:

str="BIBHU@#$%^^&*(sundar)(*&das"

Set r=new regexp
r.pattern="[a-z A-Z]"
r.global=true
set s=r.execute(str)
'For each letter in s
'result= letter.value&result
'Next
For i=s.count -1 to 0 step -1
Set oVal=s.item(i)
result=oVal.value&result
next
print result

To retrieve only special characters from the input use the
below regular expressions in the above code:
r.pattern="[^a-z A-Z]"
r.pattern="\W"


Thanks,
Uday
http://qtpftvideos.blogspot.com/

Is This Answer Correct ?    8 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If the weblist is identified as webelement,and by clicking on webelement if the values are displayed,and if the values the values also identified as webelement.then how to fetch the values through script?

4686


How Can I find the least value in a bunch of variables using qtp.. E.g.:- A = 210, B = 212, C = 60, D = 111 I don’t want to write bunch of lines for this…. Is there a way to get the result in one line…..

1612


What is business process testing(bpt) in qtp?

687


How do you capture tooltip using QTP?

628


What are the steps involved in the recovery scenario wizard?

554






what type of framework u r using in ur organization

1640


What is the default object synchronization timeout in qtp?

636


when a test case is written how u test using qtp

1646


What are the steps involved in recovery scenario wizard?

519


Our company is having a windows client server application developed in vb.net. so there is a treeview and i am not in a position to record the click events in QTP. so kindly help. Vivek

1562


Any body have QTP 9.5 licence key. please provide me at madhukar_dec30@yahoo.co.in

1593


What are the types of object repository in qtp?

559


Explain the use of action split in qtp?

557


I want to capture data(using keyword) from msdos application using QTP?... Below is little work i could do on it... /* Set app=CreateObject("Wscript.shell") SystemUtil.run ("C:\Users\Agent\Desktop\pumpsim\PUMPSIM.EXE") Window(“PUMPSIM.EXE”).Activate wait(3) app.sendkeys "N" */ Thanks in advance...!!!

1430


This is a question thats generally asked in every QTP interview. What were the problems that you faced during automation and how did you resolve them?

1463