0

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?

williamsandonz
  • 15,864
  • 23
  • 100
  • 186

1 Answers1

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.

Ariel
  • 404
  • 2
  • 4
  • Need to put it in [^] thats throwing an error, sigh I dunno if this is possible? – williamsandonz Apr 04 '12 at 01:51
  • I've never used that particular flavor of Eclipse, but on vanilla eclipse, if you just search for '(^)' and replace with 'myString + "' (both without the outer single quotes when actually typing it in), you should get the desired effect. Also, [this](http://ganeshtiwaridotcomdotnp.blogspot.com/2011/09/some-useful-regular-expressions-for.html) link shows how to access regex help for Eclipse. – Ariel Apr 04 '12 at 02:06