Notepad++ – replace every first space of a line

find and replacenotepadregex

I know there are a lot of these types of questions but I can not find a way to alter one of the existing solutions for my problem.
My text file looks like this:

word<tab>word<space>words_with_spaces

I would like to replace every first space of each line with an html linebreak (br). Is there a simple way to do this?

Best Answer

You'll have to use RegEx to search and replace.

In the search, type: (.+?)[ ](.+)
In the Replace field, type: $1<br>$2

Make sure you are not searching for \r \n (its a checkbox) otherwise it will do a multi-line search.

Related Question