Sign in to follow this  
Followers 0
Jaboowaki

Find digit with decimal point w/StringRegExp

3 posts in this topic

I am retrieving a string from a scale and need to pull out the weight from it. The string is:

$gWeightstring0 = "SNG/W+ 999.9 lb"

I have tried:

$gWeight = StringRegExp($gWeightstring0, '([0-9]{1,4})', 1)

I want to understand StringRegExp better but found nothing in help file on decimal points (or maybe I didn't understand fully when I did read it)

so I tried:

$gWeight = StringRegExp($gWeightstring0, '([:xdigit:]{1,4})', 1)

Can someone help me understand this? Thanks


Share this post


Link to post
Share on other sites



Maybe Jaboowaki

ps: crazy avatar u got bro ;)


[font="verdana, geneva, sans-serif"] [/font]

Share this post


Link to post
Share on other sites

Thank you for the help, while I was out I guessed this <autoit> $gWeight1 = StringRegExp($gWeightstring0, '([0-9]{1,4})', 1)

$gWeight2 = StringRegExp($gWeightstring0, '[0-9]+(.[0-9]{1,1})?', 1)

$gWeight = $gWeight1[0] & $gWeight2[0]</autoit>so I feel I am starting to understand

69255, Thanks for the correct StringReqExp solution, i will change mine, I am using AutoIt to automate our warehouse.


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