Sign in to follow this  
Followers 0
gseller

filtering +/- and numbers?

3 posts in this topic

I am horrible at regex.. Can someone show me what I am doing wrong? I am trying to filter out just the time difference including the plus/minus sign from:

$asResult = StringRegExp("Afghanistan: +4.5 hours.", '([0-9]{1,4})(?: hours)', 1)
If @error == 0 Then
    MsgBox(0, "SRE Example 6 Result", $asResult[0])
EndIf

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

$asResult = StringRegExp("Afghanistan: +4.5 hours.", '([\+-]*\d+\.*\d*)(?: hours)', 1)
If @error = 0 Then
    MsgBox(0, "SRE Example 6 Result", $asResult[0])
EndIf

Oops, wrong tags.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

GROOVY! Thanks SmOke_N...

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