Search code examples
regexnotepad++

Editing certain space in a line using Regular Expression


Hello I have the txt file list:

asjd
gsgs
azda

I want to edit the 2nd spot on the line so it is such:

a-jd
g-gs
a-da

I have tried playing around with the \S reg expression but I am struggling. This is out of my knowledge. Thanks in advance.


Solution

  • Try the following find and replace, in regex mode:

    Find:    ^(.).(.*)$
    Replace: $1-$2
    

    Demo