in reply to multi line pattern match

Simple enough. You don't even truly need zero width look behind and look aheads, but I think that cleans up the logic some:
use strict; my $data = do {local $/; <DATA>}; $data =~ s{(?<=\?\>)(.*?)(?=\<\?)}{printf('$1');}sg; print $data; __DATA__ <html> blah <?php xxx ?> blah <?=xxx?> blah <?php yyy blah ?> <body> </html>
- Miller

Replies are listed 'Best First'.
Re^2: multi line pattern match
by perlmonk99 (Initiate) on Dec 03, 2007 at 21:02 UTC
    Thanks a lot everybody!
    I got it to work using the above.