Sign in to follow this  
Followers 0
brodie28

StringRegExp help

8 posts in this topic

I remember there used to be a good tutorial on how to use it around but I was unable to find it...

Anyway, my script is looking at the source of a webpage. In the source, this occurs:

<br><br>This Hand: $-2500

What I am interested in returning is the dollar value. The dollar sign and everything before it is always the same, but the negative sign only shows up for negative numbers. the 2500 can be any number between -1000000 and 1000000.

How do I go about finding this number?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

$string = "This Hand: $-2500e"
$array = StringRegExp($string,"This Hand: \$(-?\d*)", 3)
MsgBox(0,"",$array[0])

Edited by weaponx

Share this post


Link to post
Share on other sites

http://www.autoitscript.com/forum/index.ph...lar++expression

http://www.autoitscript.com/forum/index.ph...lar++expression

Thankx. Do you use a external search to locate forum posts? I am probably not the only one finding the internal forum search unreliable.

Share this post


Link to post
Share on other sites

Thankx. Do you use a external search to locate forum posts? I am probably not the only one finding the internal forum search unreliable.

No I use the builtin search. You have to be very explicit i.e. +regular +expression

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  
Followers 0