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 =
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
"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(.*) boilerpl
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 additi
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 shri
urns 1 because 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'; '
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) = s
7;Jan 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.
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:
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:\
Hi all,
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;
This does neither:
my @teilnehm
11 matches
Mail list logo