Jaboowaki Posted April 30, 2012 Share Posted April 30, 2012 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 Link to comment Share on other sites More sharing options...
armoros Posted April 30, 2012 Share Posted April 30, 2012 Maybe Jaboowakips: crazy avatar u got bro [font="verdana, geneva, sans-serif"] [/font] Link to comment Share on other sites More sharing options...
Jaboowaki Posted April 30, 2012 Author Share Posted April 30, 2012 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now