C# regex to parse PHP function call list file -


i have simple problem. have php file contains lot of function-calls one:

return self::_call('client_changepassword',array(     $token,     $password,     $user_token )); 

the name , number of parameters can vary call have structure, including spaces , linebreaks.

what need regular expression grab these calls php file , split them function name (client_changepassword) , group of parameters. since file has several hundreds of different calls, needs reasonably fast, too.

the regular expression used within c# part of console application generate simple code analysis. basically, need list of methods plus parameters php calls in source , compare list of definitions stored in different project. our code reviews lot.

no, not php-related though i'm trying parse php code. system can't run php code , don't want run php code.

you can use following regex:

return\s+self::_call\('(?<name>[^']+)'\s*,\s*[aa]rray\((?:\s+\$(?<param>[^,)\n]+),?\r?\n)+ 

see demo

enter image description here


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -