Regex - escaping '

tixuo

New Member
I'm trying to parse a string and extract some values.Suddenly, I'm stuck with the with symbols here:Here is some code, to describe my situation:\[code\]// example string$string = "@set('var', 'value')";// regex that I'm using to extract the values$regex = '@set\((.+),(.+)\)/'// result that I'm gettingarray("'var'", "'value'")// desired resultarray("var", "value")\[/code\]Any ideas?
 
Back
Top