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 want to get the function name from a string of c code:

$line = "Func001( 1,2,3,4 )";

Using $line =~ /\(/;
Gives $1 = Func001;

Works great, but not on the following

$line = "Var_name[ 0 ] = Func002( d,e,r,t,)";

Using $line =~ /\(/;
Gives $1 = Var_name[ 0 ]=;

What am I missing?

Thanks,

Jerry

 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to