Notepad++ Regex – How to Use FIND/REPLACE with Wildcards

notepadregex

I have a text file with a list of filenames like so.

ABC-FS01-E-20110515045349.txt

I am trying to find a way in Notepad ++ to parse it like the following.

ABC-FS01-E-2011-05-15

I've tried using Regex, but my syntax is incorrect and I keep getting garbage.

Any thoughts? Thanks!

Best Answer

RegExp Search:

(ABC-FS[0-9]{2}-E-[0-9]{4})([0-9]{2})([0-9]{2}).*

Replace:

\1-\2-\3

I know what you're thinking: "What kind of sorcery is that?" :)

Related Question