R. Joseph Newton wrote:
R. Joseph Newton wrote: Oooops, sorry, needs a small adjustment, I
think:
Jan Eden wrote:
BTW, accessing $1 like this implies that $1, $2 ... form an array.
How can it be accessed as a whole?
my @matches =( /($regex)/g);
Ok, that should have been obvious. Thank you.
Jan Eden wrote:
R. Joseph Newton wrote:
R. Joseph Newton wrote: Oooops, sorry, needs a small adjustment, I
think:
Jan Eden wrote:
BTW, accessing $1 like this implies that $1, $2 ... form an array.
How can it be accessed as a whole?
my @matches =( /($regex)/g);
Ok, that should
Thanks for all the suggestions. This is a very helpful list.
Charles K. Clarkson wrote:
Jan Eden [EMAIL PROTECTED] wrote:
:
: I tried to stuff the following two lines into one, but did
: not succeed:
:
: my($teilnehmer) = $eingabe =~ m/(?=Teilnehmer:\n\n)(.+)/s;
: my(@teilzeilen) = split
there
is 1 element in the list. If there were more parentheses it might
return a higher number.
-Original Message-
From: Charles K. Clarkson [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 28, 2004 6:13 PM
To: 'Jan Eden'; 'Perl Lists'
Subject: RE: Two-liner to one-liner
I think
On Jan 27, Jan Eden said:
my($teilnehmer) = $eingabe =~ m/(?=Teilnehmer:\n\n)(.+)/s;
As far as I can tell, there is no need for a look-behind in this regex.
my ($teilnehmer) = $eingabe =~ /Teilnehmer:\n\n(.+)/s;
should be sufficient.
my(@teilzeilen) = split /\n/, $teilnehmer;
As for
Jan Eden wrote:
BTW, accessing $1 like this implies that $1, $2 ... form an array. How can it be
accessed as a whole?
my @matches = /($regex)/g;
my @matches = /hard-coded random stuff(.*) boilerplate(.*)more unwanted (.*)/;
Joseph
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
R. Joseph Newton wrote:
Oooops, sorry, needs a small adjustment, I think:
Jan Eden wrote:
BTW, accessing $1 like this implies that $1, $2 ... form an array. How can it be
accessed as a whole?
my @matches =( /($regex)/g);
my @matches = (/hard-coded random stuff(.*) boilerplate(.*)more
Jan Eden wrote:
Hi all,
Hello,
I tried to stuff the following two lines into one, but did not succeed:
my($teilnehmer) = $eingabe =~ m/(?=Teilnehmer:\n\n)(.+)/s;
my(@teilzeilen) = split /\n/, $teilnehmer;
This does not work:
my @teilnehmer = $eingabe =~ m/(?=Teilnehmer:\n\n)(.+)/s;
Jan Eden [EMAIL PROTECTED] wrote:
:
: I tried to stuff the following two lines into one, but did
: not succeed:
:
: my($teilnehmer) = $eingabe =~ m/(?=Teilnehmer:\n\n)(.+)/s;
: my(@teilzeilen) = split /\n/, $teilnehmer;
Care to share a typical value for $eingabe with us?
How about:
Eden'; 'Perl Lists'
Subject: RE: Two-liner to one-liner
I think(?) ( $eingabe =~ /(?=Teilnehmer:\n\n)(.+)/s )[0]
is forcing the regex into list context. In scalar context it returns 1
(for success?) and split assumes scalar context of its second argument.
--
To unsubscribe, e-mail: [EMAIL
10 matches
Mail list logo