Notepad++ regex (string replacement)

nahaczyku

Newbie
Joined
Oct 12, 2009
Messages
35
Reaction score
8
Can someone help me create a regular expression that I would like to use in the notepad++ editor?

I have a large list of domains and I would like the regex to replace the first two characters with a word of my choice after the twelfth character in the line.

List
Code:
https://www.domainexample.com
http://www.dmexample.copm
https://example.com 
http://domainex.com

Result
Code:
https://www.(myword)mainexample.com
http://www.d(myword)mexample.com
https://exam(myword)ple.com
http://domai(myword)nex.com
 
Problem solved

Find: ^(.{12}).(..)(.*)$
Replace with: \1(myword)\3
 
Last edited:
Back
Top