RegEx (or other) parsing of script
Posted
by
jpmyob
on Stack Overflow
See other posts from Stack Overflow
or by jpmyob
Published on 2011-06-22T19:18:09Z
Indexed on
2011/06/23
16:22 UTC
Read the original article
Hit count: 227
RegEx is powerful - it is tru but I have a little - query for you
I want to parse out the FUNCTIONS from some old code in JS...however - I am RegEx handicapped (mentally deficient in grasping the subtleties).. the issue that makes me NOT EVEN TRY - is two fold -
1) myVar = function(x){ yadda yadda }
AND function myVar(x) { yadda yadda }
are found throuout - COLD I write a parser for each? sure - but that seems inefficient...
2) MANY things may reside INSIDE the {}
including OTHER sets of {}
or other Functions(){}
block of text...
HELP - does anyone have, or know of some code parsing snippets or examples that will parse out the info I want to collect?
Thanks
© Stack Overflow or respective owner