enclose code and testfile.
vogelke+unix at pobox.com
Sun Jun 7 20:55:02 UTC 2009
>> On Sat, 6 Jun 2009 18:22:00 -0700,
>> Gary Kline <kline at thought.org> said:
G> I'm encloseing a brief C program that skips over php delimiters and a
G> 74-byte test file. Am wondering if there is a better way.
# skip PHP stuff in a file
my ($prev, $match);
# slurp up the entire file.
$_ = <>;
(.*?) # get text that doesn't include delimiters...
(<\?.*?\?>) # ... plus text in ONE set of delimiters...
//xsm) # ... matching across multiple lines
$prev = $1; # text before <?
$match = $2; # text inside <?...?>
print "$_\n"; # whatever's left over.
Karl Vogel I don't speak for the USAF or my company
Programming is like sex: one mistake and you have to
support for a lifetime. --unknown
More information about the freebsd-questions