I have a file stored and I'm reading it with Javascript. The problem is that I want to simulate a syntactic validator and I can't get a good result.
syntax.txt:
class foo {
}
The problem is that I can't get the class content. What I do is verify if there's a class statement:
fileString.match(\^class\g);
This returns me: ["class"]
, but I want to get foo { }
and everething inside.
This is possible?
And what happend if the file changes? something like: syntax.txt:
class foo {
}
class bar {
}
Thanks!