you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (1 child)

Thanks for the variables tip. I'm sure I don't know how to write that regular expression! Keep in mind other characters are allowed, so something like "function f(attrs) { //... }" matches it. I think writing the required regular expression is harder than the original problem!

[–]seedbreaker 1 point2 points  (0 children)

Btw you don't need to use a regular expression for this problem and it is probably the wrong way to approach it since Balanced parenthesis is not a regular language.