Janek Schleicher wrote:
> Rob Dixon wrote at Thu, 27 Mar 2003 12:51:46 +:
>
> >
> > I'm afraid your regex is wrong! It does the following:
>
> Yep, it was a typo and untested.
>
> > capture zero or more (as few as possible) of any character
> > !! match one or more 'word' characters follow
Rob Dixon wrote at Thu, 27 Mar 2003 12:51:46 +:
> Janek Schleicher wrote:
>> > $data = "David (man from uncle)";
>> >
>> > $data = "John Doe (The boy down the hall)";
>> >
>> > What I want to do is split $data into two string variables, one holding the
>> > $name, and the other holding all
Stefan Lidman wrote at Thu, 27 Mar 2003 13:55:27 +0100:
> Janek Schleicher wrote:
>> I would use a regexp:
>>
>> my ($name, $info) = $data =~ /(.*?)\w+\((.*)\)/;
>
> I guess you ment:
> my ($name, $info) = $data =~ /(.*?)\s*\((.*)\)/;
Yep.
Cheerio,
Janek
--
To unsubscribe, e-mail: [EMAIL PR
Janek Schleicher wrote:
>
> Jimstone7 wrote at Thu, 27 Mar 2003 06:39:25 -0500:
>
> > $data = "David (man from uncle)";
> >
> > $data = "John Doe (The boy down the hall)";
> >
> > What I want to do is split $data into two string variables, one holding the
> > $name, and the other holding all
Janek Schleicher wrote:
> Jimstone7 wrote at Thu, 27 Mar 2003 06:39:25 -0500:
>
> > $data = "David (man from uncle)";
> >
> > $data = "John Doe (The boy down the hall)";
> >
> > What I want to do is split $data into two string variables, one holding the
> > $name, and the other holding all the
Jimstone7 wrote at Thu, 27 Mar 2003 06:39:25 -0500:
> $data = "David (man from uncle)";
>
> $data = "John Doe (The boy down the hall)";
>
> What I want to do is split $data into two string variables, one holding the
> $name, and the other holding all the $info that is within the parens. How
Hi,
Somethig like this should work (untested):
my ( $name, $info ) = split /\(/, $data;
regards, Aim.
[EMAIL PROTECTED] wrote:
> I'm having a problem splitting a variable and need some help. What I have is
> some variables with a na
Hi Romek,
Try with
\s*=\s*
Naren.
Romek KrisztiƔn wrote:
> Hello!
>
> What's the problem with my split?
>
> $line = "var=value";
> ($var, $value) = split(/\s*[=]\s*/, $line);
>
> Krisztian
>
> I experienced that $var and $value contained the first letter of the var and
> the value. Som
On 8/5/01 9:39 PM, Romek KrisztiƔn wrote:
> Hello!
>
> What's the problem with my split?
>
> $line = "var=value";
> ($var, $value) = split(/\s*[=]\s*/, $line);
>
> Krisztian
>
> I experienced that $var and $value contained the first letter of the var and
> the value. Sometimes nothin
> What's the problem with my split?
>
> $line = "var=value";
> ($var, $value) = split(/\s*[=]\s*/, $line);
Looks fine to me.
> I experienced that $var and $value contained the first letter of the
var and
> the value. Sometimes nothing. Where is the error?
Looks to me like it must be in
10 matches
Mail list logo