Reputation: 59
How can I make a regex that matches all new-line-characters ONLY when it begins with a " ' " character? Example:
'Hello World > Match "/n" after "d"
Hello World > No match
'Test > Match "/n" after "t"
Test > No match
'''''Xample > Match "/n" after "e"
Xample > No match
WOW 'He > Match "/n" after "e"
Thanks in advance ;)
Edit: All that I want are place tags on the BEGINNING and at the ENDING of each line that has this "comments". Like this:
WOW <blabla>'Hello<blabla>
The beginning I can just normally replace " ' " with " ' ", but the ending is a bit more difficult.
Upvotes: 1
Views: 2846
Reputation: 7948
use this pattern
^([^']*)('+)(.*)(\r?\n|$)
and replace w/ $1<tag>$2$3</tag>$4
Demo
Upvotes: 1