home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / perl / 7097 < prev    next >
Encoding:
Internet Message Format  |  1992-11-22  |  735 b 

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