For some reason I can’t seem to match a parentheses in Flex using Regex to save my life.
What’s wrong with this?
var commandTxt:String = "switchview(adf)";
var switchViewArray:Array = commandTxt.match(new RegExp("switchview\(", "i"));
I’ve tried dozens of things, but I can’t seem to get a match the parentheses. What’s the catch here?
I never used Flex, but most likely this is because the
\has a special meaning in double quotes.Use a double-escape:
Or you can also write: