Page 1 of 1

Retain the wildcard when replacing string

Posted: Sat Feb 13, 2010 5:52 am
by kosmetikstudio
Hi there, I´ve been trying to raplace some strings in some files using Notepad++.

I of course need to find the appropriate string, which is not that big of a problem:

Code: Select all

TAG(.*)myemail@gmail.com
But what I need to do now is, insert a line break before "TAG", but only before those lines, that contain my email adress at the end. ? I have been searching way too long for this, hope that someone has a quick answer :).

Thanks in advance!

Re: Retain the wildcard when replacing string

Posted: Sun Feb 14, 2010 10:51 am
by ridgerunner
If I understand you correctly, you would like to add a newline before any 'TAG' which has your email following it on the same line. Assuming that your linebreak is just a \n newline (and not a carriage return newline \r\n combination), try this:

Code: Select all

Find what:
(TAG.*myemail@gmail\.com)
 
Replace with:
\n\1
You did not provide a very clear description of your problem. Next time, please provide some sample text that is representative of the data you are searching through as well as some text thst shows what you want it to look like when its finished. (i.e. Read the posting guidelines)