just insert text without replacement

A place to try and solve your RegEx problems.
Post Reply
sonic406
Posts: 2
Joined: Thu Feb 12, 2015 8:33 am

just insert text without replacement

Post by sonic406 »

Hello
I was just wandering if its possible to insert a line at the Beginning and the End of the file without replacing it with other lines?

Thank you in advance for any help in this matter.
User avatar
DigitalVolcano
Site Admin
Posts: 1717
Joined: Thu Jun 09, 2011 10:04 am

Re: just insert text without replacement

Post by DigitalVolcano »

You can use the regular expressions ^ and $ to insert at the the beginning or end of a file. Make sure Multi-line anchors is turned off.

So to insert a line at the start of a file:

RegEx:
^
Replace:
This is a new line\r\n

Try it in the RegEx tester.
sonic406
Posts: 2
Joined: Thu Feb 12, 2015 8:33 am

Re: just insert text without replacement

Post by sonic406 »

thank you so much
Post Reply