soad1982 Posted May 7, 2009 Share Posted May 7, 2009 Hey, Im trying to get from the Local $var = "10:12:03" the second value beteween the : : and save it on another variable. I cannot use StringRegExpReplace because the "12" is not always "12". In Linux I would use awk searching the pattern : and print $2, but I have no idea how to make it work using autoit. Thanks in advance. -Jose Link to comment Share on other sites More sharing options...
Zedna Posted May 7, 2009 Share Posted May 7, 2009 Look at _StringBetween() BTW: you can use also directly StringRegExp() in this case. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
soad1982 Posted May 7, 2009 Author Share Posted May 7, 2009 This was really easy.I choose at the end the spit command. aEvent = "10:50:2" $Time = StringSplit($aEvent, ":") If $Time[0] >= $HOUR Then ;Compare Hour If $Time[1] >= @MIN Then ; Compare Minute Thanks. Link to comment Share on other sites More sharing options...
Skizmata Posted May 7, 2009 Share Posted May 7, 2009 Regular Expressions are fun and powerful! As a perl developer I *heart* regular expressions.$array = StringRegExp("12:34:45", '(\d?\d):(\d\d):(\d\d)', 2) MsgBox(0, "Time Parts", "Full Time is... " & $array[0] & " Hours Are " & $array[1] & " Minutes Are " & $array[2] & " Seconds Are " & $array[3]) AutoIt changed my life. 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