The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Hi lorenw, thanks for the suggesting but the string will have multiple new lines which some will need to be removed and others not (i.e. if they begin with a number and coma) so I don't think that method would work.

Yes, you have to use a delimiter and "~" is my favorite one. If you use "/" and you have to match slashes (e.g. in an URL) then you would have to escape all occurrences of "/" within the regex, which makes the expression less legible. Of course, if you have to match lots of tildes, then you should use another delimiter.