Search code examples
regexidereplacemyeclipse

Regex to match start of line and end of line for quick find and replace


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?


Solution

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