home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!eiffel!eiffel.com
- From: ram@eiffel.com (Raphael Manfredi)
- Newsgroups: comp.lang.perl
- Subject: Re: Using $*, but pattern doesn't match
- Message-ID: <120@eiffel.eiffel.com>
- Date: 25 Aug 92 20:40:14 GMT
- References: <1992Aug25.181818.13613@advtech.uswest.com>
- Sender: ram@eiffel.com
- Organization: Interactive Software Engineering, Santa Barbara CA
- Lines: 22
-
- Quoting rray@lookout.it.uswc.uswest.com (Randy J. Ray) from comp.lang.perl:
- >I thought that ".* would match anything (up to a final ")" in this case)
- >with $* set to 1?
-
- Reading The Fabulous Manpage:
-
- "Regular Expressions
- [...]
- To facilitate multi-line substitutions, the . character
- never matches a newline (even when $* is 0). In particular,
- the following leaves a newline on the $_ string:
-
- $_ = <STDIN>;
- s/.*(some_string).*/$1/;
- "
-
- You have to use [.\n] if you want to match anything.
- --
- Raphael Manfredi <ram@eiffel.com>
- Interactive Software Engineering Inc.
- 270 Storke Road, Suite #7 / Tel +1 (805) 685-1006 \
- Goleta, California 93117, USA \ Fax +1 (805) 685-6869 /
-