0

I have a link by this text,

s= "http://xyz.com/Getid.ashx?JobID=250920&JobTitle=office+junior&seswitch=1&lid=801&AVSDM=2012-11-22+11%3a33%3a00"

I need to extract two information from this link

1)JobID which "250920"

2)JobTitle which is "office junior"

Is this possible by using gsub will I be able to get only those text from the link?

4

1 回答 1

0

You can try .match with a regex:

result = s.match(/JobID\=(\d+).+JobTitle\=([a-zA-Z+0-9]+)\&/)

result[1] #JobID

result[2] #JobTile

于 2012-11-22T14:32:15.117 回答