Re: multilinepattern match
From: Sara (genericax_at_hotmail.com)
Date: 11/17/03
- Next message: Wally Sanford: "Re: regex to convert 1000000 -> 1,000,000 ?"
- Previous message: Uri Guttman: "Re: Learn Regex or Perl Frist?"
- In reply to: Sunil: "multilinepattern match"
- Next in thread: James Willmore: "Re: multilinepattern match"
- Reply: James Willmore: "Re: multilinepattern match"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 17 Nov 2003 10:42:37 -0800
"Sunil" <sunil_franklin@hotmail.com> wrote in message news:<Np%tb.1$U71.32@news.oracle.com>...
> Hi,
> I have to match a string like
>
> "end;
> /"
>
> in a file. Any suggestions on how to do this?
>
> Thanks,
> Sunil.
look at the "s" and "m" switches in perl regexes, for starters they
are very useful for multiline inputs.
On this other hand you can do this match with no switches:
#!/usr/bin/perl -wd
$_ = "a bunch of
stuff
is here..
end;
/
thats all
folks";
print "Eureka!\n" if /end;\n\//;
************************************************************************
I guess would be one way?
-G
- Next message: Wally Sanford: "Re: regex to convert 1000000 -> 1,000,000 ?"
- Previous message: Uri Guttman: "Re: Learn Regex or Perl Frist?"
- In reply to: Sunil: "multilinepattern match"
- Next in thread: James Willmore: "Re: multilinepattern match"
- Reply: James Willmore: "Re: multilinepattern match"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|