Re: regex extraction problem
- From: krahnj@xxxxxxxxx (John W. Krahn)
- Date: Sun, 28 May 2006 21:16:11 -0700
Chad Perrin wrote:
On Sun, May 28, 2006 at 03:08:07PM -0700, John W. Krahn wrote:
tom arnall wrote:
On Sunday 28 May 2006 12:20 am, John W. Krahn wrote:
tom arnall wrote:
the following code:
$_='abcd';
@f = /(x)(y)|(a)(b)/;
makes the first two cells of '@f' to be undefined, then puts 'a' and 'b'
in the third and fourth cells. how do i get the system to put 'a' and 'b'
in the first two cells and to produce no undefined cells?
@f = grep defined, /(x)(y)|(a)(b)/;
yes. solves my problem. how did you find out about this?
By programming in Perl for many years. :-)
Did it also teach you why that's necessary?
It is not necessary, but it seemed to be what the OP wanted.
John
--
use Perl;
program
fulfillment
.
- References:
- regex extraction problem
- From: Tom Arnall
- Re: regex extraction problem
- From: John W. Krahn
- Re: regex extraction problem
- From: Tom Arnall
- Re: regex extraction problem
- From: John W. Krahn
- Re: regex extraction problem
- From: Chad Perrin
- regex extraction problem
- Prev by Date: Re: accessor problem in OO
- Next by Date: Re: accessor problem in OO
- Previous by thread: Re: regex extraction problem
- Next by thread: regular expression problem ? and * characters
- Index(es):
Relevant Pages
|
|