As for notepad++ to restrict a regular expression on only one line?

There is a solution to this:
----------------------------------------------------------------------------------------------------------------------------------------------------
"Suppose you want some text, copied for example from a word, to conclude in tags

Put in "find" — (^.*$) looking for the start and end of the row.

Put in the "replace with" — \1 and what you need to insert at the beginning and end of a string, in our example it is

The expression will be as follows:\1. As shown in figure 1. In the future, there is no need for pictures, they will be identical to this, with the only difference that expressions, there will be others."
----------------------------------------------------------------------------------------------------------------------------------------------------
But it works on the entire document. I need only one row, h1 is assigned. There are too many documents that would be needed if you replace in all documents h1 was inserted into the end and the beginning only 1 line. And he's every frame. Thanks in advance.
March 20th 20 at 11:25
1 answer
March 20th 20 at 11:27
Use sed-om.

sed -i '1 s/regular expression/what to replace/'

The command will replace only the first line in the file.

Find more questions by tags Notepad++