Jump to content
Sign in to follow this  
cageman

another regexp question

Recommended Posts

cageman

i have a very big text file with a sentence like:

<a href=link.asp?id=4585336>Variablename</a>

the only things that change are 4585336 and Variablename. I just want to get an array of all the id's using StringRegExp().

I don't have much experience with it and i got stuck.. I don't need to check if its a link, but i want the id's in an array (they can be variable in length). I have come up with this:

StringRegExp($string,"(?:link.asp?id=)(\d+)",3)

it doesn't work, but i am hoping someone smart can solve this ;)

Edited by cageman

Share this post


Link to post
Share on other sites
cageman

that was very helpful ;) it turned out i was very very close.. StringRegExp($string,"(?:link.asp\?id=)(\d+)",3) did the job.. needed to point out the ? was not a special character.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×