"Var_name[ 0 ] =" and not "Func002";
>
> Thanks,
>
> Jerry
>
> -Original Message-
> From: Brandon Willis [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 22, 2005 9:30 PM
> To: Jerry Preston
> Cc: 'Perl Beginners'
> Subject:
As far as I can see you aren't missing anything.
perl -e '$a="foo [ 0 ] = function(1,2,3,4)"; $a=~/(\w+)\(/; print $1'
works great for me. =)
But you might think about using this:
perl -e '$a=" foo [ 0 ] = function (1,2,3,4)"; $a=~/\b(\w+)\b\s*?\(/;
print $1'
The zero width assertion \b and the
10:04 PM
To: Jerry Preston
Cc: 'Perl Beginners'
Subject: RE: Regex c code
Very strange... What platform and perl are you on? I'm on RH7.3 perl 5.6.1.
And could you try this:
my $a=" foo [ 0 ] = function(a,b,v,t)";
$a=~/\b(\w+)\b\s*?\(/;
print "\$` =|$`|\n\$& =
Brandon,
I found my error! This part is working correctly.
Thanks for your help!
Jerry
-Original Message-
From: Jerry Preston [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 22, 2005 9:47 PM
To: 'Brandon Willis'
Cc: 'Perl Beginners'
Subject: RE: Regex c code
Brandon,
Tried your code and I am still getting "Var_name[ 0 ] =" and not "Func002";
Thanks,
Jerry
-Original Message-
From: Brandon Willis [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 22, 2005 9:30 PM
To: Jerry Preston
Cc: 'Perl Beginners'
Subject:
Correction!
I am using /(\w+)\(/ and not /\(/.
Thanks,
Jerry
-Original Message-
From: Jerry Preston [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 22, 2005 9:17 PM
To: 'Perl Beginners'
Subject: Regex c code
Hi!
This seems to so simple, but I do not see what I am doing wrong.
I w