RE: [PHP] Regular expression help converting doc to xml

2002-10-02 Thread Geoff
(For the archives) The RegEx I finally used was this: search: D(.*) replace: DD\1/DD I tried this in 3 editors: jEdit, eMacs and BBEdit jEdit interpreted the replace expression as literally \1 eMacs didn't like the parenthesis in the search string In BBEdit it worked like a charm. Not sure

RE: [PHP] Regular expression help converting doc to xml (somewhatOT)

2002-09-30 Thread Geoff
On Fri, 2002-09-27 at 16:53, John Holmes wrote: This isn't accurate enough because DT is not always preceeded by: DD some text. It is sometimes preceeded by DT some text /DT or other items. This expression matches fairly well: DD[a-zA-Z0-9\.,'\-\s]* So it matches up to the DT: DD A whole bunch

RE: [PHP] Regular expression help converting doc to xml

2002-09-27 Thread John Holmes
I have a fairly large html document that I need to convert to xml. The current format is is: DD A whole bunch of text DT Something else /DT (There is a new line in there before DT) Which I need to convert to DD A whole bunch of text /DD DT Something else /DT $new_text =