Search code examples
characternotepad++swap

Notepad++ how to swap characters in a string


I have a computer generated text file. I need to swap positions of certain entries. These entries are always 4 characters long and separated from the rest by semicolons. The 4th character needs to become the first character.

For example:

;1234; 

has to become:

;4123;

Note: There's a lot of other text separated by semicolons, but only these are exactly 4 characters long. The rest is longer or shorter


Solution

  • Have a try with:

    Find what: ;(\d\d\d)(\d);
    Replace with: ;$2$1;