Search code examples
regexexpressionnotepad++

How to reverse this expression using notepad++ regex


I have a file which is full of these lines(and some other stuff) and "SUMMARY" is an identical start of line.

SUMMARY:1991/04/08
SUMMARY:1211/08/10

the numbers can be anything. I want to reverse it so it will be like:

SUMMARY:08/04/1991
SUMMARY:10/08/1211

How can I do it with notepad++ or any other software. by the way, can you give me a refrence for this regex replacing thing. Thanks


Solution

  • Read about capturing groups here.

    Search for

    ^SUMMARY:(\d{4})/(\d{2})/(\d{2})
    

    and replace with

    SUMMARY:\3/\2/\1