I don't know how this works, But I have seen this regexp comparison it in
perlop man pages. It has been very good regexp.
Can anyone explain this for me.
#! /usr/bin/perl
# open the file
open(fileHandle, "Cfile") || die "can't open the file ";
# read the file in scalar
while(<fileHandle>) {
$program .= $_;
}
# Delete (most) C comments.
$program =~ s {
/\* # Match the opening delimiter.
.*? # Match a minimal number of characters.
\*/ # Match the closing delimiter.
} []gsx;
print $program
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 20, 2001 1:33 PM
To: [EMAIL PROTECTED]
Subject: Another regular expression question?
I am also very new to Perl! I need to figure out how I could skip a
block of comments in a C header file. For example, if I have something
like the following:
/* This is my block of comments.....blah
....blah....................................................................
.and
lots more comments here........
and then even more here!.................... with my end of comments
indentifier on the next line!.........
*/
And then the actual code down further needs to be processed. Any help
would mean alot to a beginner like me.
Thanks
YM
RE: Another regular expression question?
Amarnath Honnavalli Anantharamaiah Fri, 20 Apr 2001 02:29:02 -0700
- Another regular expression question? Yvonne Murphy
- RE: Another regular expression que... Amarnath Honnavalli Anantharamaiah
- RE: Another regular expression que... bbking
- RE: Another regular expression... Amarnath Honnavalli Anantharamaiah
- RE: Another regular expression que... King, Jason
- RE: Another regular expression... Amarnath Honnavalli Anantharamaiah
- RE: Another regular expression que... King, Jason
- Re: Another regular expression que... Walnut
- Re: Another regular expression... Curtis Poe
- RE: Another regular expression que... Bob Showalter
