home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!icd.ab.com!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!news!netlabs!lwall
- From: lwall@netlabs.com (Larry Wall)
- Newsgroups: comp.lang.perl
- Subject: Re: Punctuation in Regex, or Wouldn't a \p be nice?
- Message-ID: <1992Sep3.182254.12438@netlabs.com>
- Date: 3 Sep 92 18:22:54 GMT
- References: <1992Sep2.232753.3020@cs.unca.edu>
- Sender: news@netlabs.com
- Organization: NetLabs, Inc.
- Lines: 16
- Nntp-Posting-Host: scalpel.netlabs.com
-
- In article <1992Sep2.232753.3020@cs.unca.edu> mcmahan@cs.unca.edu (Scott McMahan -- Genesis mailing list owner) writes:
- : A really nice thing for perl to do would be to provide \p as a
- : regular expression like \s that would match one punctuation
- : character. (!@#$%^&*()_-+=~`}]{[|\"':;?/>.<, :^))
- :
- : Since most of these are also regular expression characters, it
- : would eliminate a lot of \-ing.
- :
- : Is there an easy way to put a lot of punctuation in a regex
- : without tons of quoting? (q and qq don't look like they'd work)
-
- It looks like [^\w\s] would be pretty close to what you want. Note
- also that, within [], only @$-]\ (and whatever your pattern delimiter is)
- need to be backwhacked. The others, .[{}*+?|(), are not special inside [].
-
- Larry
-