home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!portal!cup.portal.com!Eric-Amick
- From: Eric-Amick@cup.portal.com (Richard E Amick)
- Newsgroups: comp.lang.perl
- Subject: Re: Regex question
- Message-ID: <70057@cup.portal.com>
- Date: Sun, 22 Nov 92 15:49:15 PST
- Organization: The Portal System (TM)
- Distribution: usa
- References: <1ejsonINNeal@fido.asd.sgi.com>
- Lines: 11
-
- >I thought I knew how to do this... guess I don't. I want to have
- >something like this:
- >
- >($suit, $pip) = /(\S+) of (Spade|Heart|Club|Diamond)/;
- >
- >but that doesn't work. What will?
-
- Besides having $suit and $pip backwards, you might want to allow
- differing whitespace in the pattern. How about \s+ instead of the
- spaces? Another possibility is that $_ doesn't contain what you think
- it does.
-