Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using preg_replace in multiline

Status
Not open for further replies.

RicoCali

Programmer
Dec 7, 2002
80
US
I have a situation where I am parsing a file and looking for two combined lines that meet the criteria. Unfortuneately, Regular Expression evaluates per line...unless I'm ignorant about something. Is there a way to match more then one line as a combination and replace text from both lines with regular expression?

TIA,
Rico
 
if it has line breaks recorded in it, be sure your expression contains the line break character when you try to match the two lines... (not sure how, but you can look it up)

if that doesnt work, perhaps the other set of reg exp functions would work (reg instead of preg for example).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top