Jump to content

stringregexp


golfinhu
 Share

Recommended Posts

#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 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

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

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...