RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find PHP Function Regex
Expression
^\s*\w+\s*\((\s*(("|')([^\3]+|\\\3)\3|\$?[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]|[0-9]*)\s*,?)*\s*\)
Description
I needed a regex to parse PHP functions, so I made it and here it is. It will not validate with array variables as the function arguments.
Matches
myfunction('string', "another", 123 ,$var2, CONSTANT )
Non-Matches
my=function('str'ing', $1var, 133t,$array[2] )
Author Rating: The rating for this expression. Ivik Injerd
Source
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Copyright © 2001-2024, RegexAdvice.com | ASP.NET Tutorials