home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uwm.edu!ogicse!reed!mjeffery
- From: mjeffery@reed.edu (Mark Jefferys)
- Newsgroups: comp.lang.perl
- Subject: Re: In 5.0, are we gonna get...
- Message-ID: <1992Dec15.053156.1836@reed.edu>
- Date: 15 Dec 92 05:31:56 GMT
- Article-I.D.: reed.1992Dec15.053156.1836
- References: <1992Dec14.043835.23009@reed.edu> <1992Dec14.192007.7534@wdl.loral.com>
- Organization: Reed College, Portland, OR
- Lines: 38
-
- In article <1992Dec14.192007.7534@wdl.loral.com> mab@wdl39.wdl.loral.com (Mark A Biggar) writes:
- % In article <1992Dec14.043835.23009@reed.edu> mjeffery@reed.edu (Mark Jefferys) writes:
-
- % > map(/(\d+)/, "asdf 23fjk4", "qwerty", "123 ")
- ^ forgot the `g'
-
- % > would return ("23", "4", "123").
-
- % Easily constructed using grep:
- %
- % grep((/(\d+)/,$_=$1), "asdf 23jfk4", "qwerty", "123 ")
-
- This seems to fail badly on my perl -- besides, it destroys the list,
- which I don't want it to do.
-
- % >2) a way of only matching the real beginning/end of a *string* in a
- % > regexp? Currently, '^' and '$' match the beginning and ending of
- % > a line (with simplifying assumptions when $* == 0). A string match
- % > would ignore newlines and $*.
- % >
- % > A new option on pattern matches might do it: `/^\d+$/s' might match
- % > "23", but not "23\n" or "x\n45". The option should treat `.' as
- % > matching "\n", as well as every other character -- so the option
- % > means that "\n" should not be treated specially.
- %
- % I believe that ^ at the beginning of a pattern will only match the beginning
- % of a string and $ at the end only the end, $* has effect only on embedded
- % ^ and $ in the middle of a pattern.
-
- No. ^ matches the beginning of a string or right after a newline, and
- $ matches the end of string or right before a newline. When $* is 0,
- perl assumes that a newline only occurs at the last character of the
- string.
-
-
- Mark
- --
- Mark Jefferys Internet: mjeffery@reed.edu
-