hi there,
i have a basic knowledge of regex, but i came across a problem that exceeded my skills. i have a string like this:
[text][AB] SomeText (26-10-2016)[/text]
and using regex i want to transform it to:
[text][AB] 2016.10.26 - SomeText[/text]
is that possible? what regex command could i use for this?
greetz
regex to rearrange string
Moderator: General Moderators
Re: regex to rearrange string
Regular expressions don't have "commands".
Match each portion of the string that you want to deal with, then put each into the substitution string wherever you want. For example, the search and replace could be
The [AB] doesn't change so actually you could just ignore that part.
Match each portion of the string that you want to deal with, then put each into the substitution string wherever you want. For example, the search and replace could be
Code: Select all
\[(..)\] (.*?) \((\d\d)-(\d\d)-(\d\d\d\d)\)
Code: Select all
[\1] \5.\4.\3 - \2