Regex to match start of line and end of line for q

2019-09-17 11:58发布

问题:

Hey guys I've got a whole lot of HTML to format with

myString + "<somehtml></somehtml>";

Need 2 regex things, one to replace all new lines with myString + " and one to replace all end of lines with ";

Just using MyEclipse, Find and replace with regex enabled. Could anyone help me out?

回答1:

Individual regular expression engines may vary, but generally speaking, '^' will match the beginning of a line and '$' will match the end of a line.