Newsgroups: comp.lang.perl.misc
From: "advice please wireless 802.11 on RH8" <buell...@gmail.com>
Date: Fri, 9 May 2008 11:22:57 -0700 (PDT)
Local: Fri, May 9 2008 2:22 pm
Subject: I need to extract an array from a scalar regex-wise ?
This is not a homework assignment. I'd be interested in more elegante'
solutions than mine is all.. Let's say I want to extract all of the days of the week out of a $_ = I want a regex/map/grep/etc (no iterative clauses PLEASE!) that @days = qw( Monday Sunday Saturday Thursday Tuesday Wednesday ) My best shot is: Which, oddly, doesn't seem to work. I say "oddly", because /((mon|tues|wednes|thurs|fri|satur|sun)day)/gi = 0 'Saturday' yet %{ /((mon|tues|wednes|thurs|fri|satur|sun)day)/gi } is an empty array!? *TILT* I'm also not crazy about the hash solution because order may be You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||