golfinhu Posted December 23, 2010 Share Posted December 23, 2010 people, please help me! wath's wrong? $regular = StringRegExp($text, "(\d|[012]\d|3[01])/(\d|1[012])/\d{4}", 3) i need this return dates on format DD/MM/AAAA thanks a lot! Link to comment Share on other sites More sharing options...
Xenobiologist Posted December 23, 2010 Share Posted December 23, 2010 (edited) #include <Array.au3> $text = '31/12/2000 and 02-02-1234 and 12/12/2001' $regular = StringRegExp($text, "([0123]\d)/([01]\d)/(\d{4})", 3) _ArrayDisplay($regular) Edited December 23, 2010 by Xenobiologist Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
golfinhu Posted December 23, 2010 Author Share Posted December 23, 2010 this code is returning the date broken 31 12 2000 12 12 2001 ... =[ Link to comment Share on other sites More sharing options...
Xenobiologist Posted December 23, 2010 Share Posted December 23, 2010 Oh, I thought that the output should be separated. Just remove the () and then all should be in one Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
golfinhu Posted December 23, 2010 Author Share Posted December 23, 2010 (edited) ah I understand, the autoit returns the values separated by groups, $1 $2 $3 I do it is to return the general? but it worked, thank you thanks! Edited December 23, 2010 by golfinhu Link to comment Share on other sites More sharing options...
Xenobiologist Posted December 23, 2010 Share Posted December 23, 2010 ah I understand, the autoit returns the values separated by groups, $1 $2 $3 I do it is to return the general? but it worked, thank you thanks! Sorry, I don't understand whether there is still a question left. If you do it this way (without the brackets( ) ) then you 'll get the date ich one string like 12/11/2000 #include <Array.au3> $text = '31/12/2000 and 02-02-1234 and 12/12/2001' $regular = StringRegExp($text, "[0123]\d/[01]\d/\d{4}", 3) _ArrayDisplay($regular) Depends on what you want :-) Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
golfinhu Posted December 23, 2010 Author Share Posted December 23, 2010 (edited) i've done! the final code! $regular = StringRegExp($text, "\b(?:\d|[012]\d|3[01])/(?:0?\d|1[012])/(?:\d{4})", 3) but his help was very helpful! thankyou so much! Edited December 25, 2010 by golfinhu 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