Syntactic Confectionery Delight | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I’m trying to write a regex that will capture a function in JavaScript - although the language in which the function is written really doesn’t matter. I have this JavaScript code:
I’m trying to capture the entire “submitme()” function from the word “function” all the way to the closing curly bracket of just that function. I’ve come across a recursive pattern that will capture a pair of outer brackets and all nested ones, but once you add the beginning text - the word ‘function’, the function name, and the opening and closing argument brackets - problems ensue. This may not be that hard, but I've had a heck of a time writing the right pattern. Any help (an example pattern) would be greatly appreciated. In reply to Recursive Regular Expression Help by me
|
|