Search code examples
regexdatetextpad

How do I replace date format using TextPad?


How do I do a replace using TextPad for all date occurrences such as

01-Apr-2014 02-Apr-2014 03-Apr-2014

to

2014-Apr-01 2014-Apr-02 2014-Apr-03

I tried a bunch of regular expressions for the date, but can't even get it working once. Thanks.


Solution

  • You can use this regex:

    (\d+)-(\w+)-(\d+)
    

    Working demo

    And then change the order of capturing group index:

    enter image description here