sathish Posted July 12, 2012 Share Posted July 12, 2012 Hello Forum Here is my perl code $Curr="Sathish 1184-1194, Suresh 1185-1195"; while($Curr=~m/(\d+)-(\d+)/g)#####WHILE LOOP { my $number1="$1";####SAVING First REGEX VALUE as $number1 my $number2="$2";####SAVING Second REGEX VALUE as $number2 } I searched in autoit forum to write a code like above in autoit, but it seems, i should follow some other way to write a code like this I have to write a script in which a variable contains "Sathish 1184-1194, Suresh 1185-1195" In the variable i have to search all the instances of (\d+)-(\d+) into a another variables Please guide me Thanks & Regards Sathish V. Link to comment Share on other sites More sharing options...
AZJIO Posted July 12, 2012 Share Posted July 12, 2012 #include <Array.au3> $Curr="Sathish 1184-1194, Suresh 1185-1195" $test=StringRegExp($Curr, '(d+-d+)', 3) _ArrayDisplay($test, 'Yes?') $test=StringRegExp($Curr, '(d+)-(d+)', 3) _ArrayDisplay($test, 'Yes?') My other projects or all Link to comment Share on other sites More sharing options...
sathish Posted July 13, 2012 Author Share Posted July 13, 2012 #include <Array.au3> $Curr="Sathish 1184-1194, Suresh 1185-1195" $test=StringRegExp($Curr, '(d+-d+)', 3) _ArrayDisplay($test, 'Yes?') $test=StringRegExp($Curr, '(d+)-(d+)', 3) _ArrayDisplay($test, 'Yes?') Thanks Friend It helped me a lot 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