I'm reading some file contents and I want to match all function calls that is not test() in nodejs. test() can have any type of parameters and as many as possible. And all matched functions should include all the parameters including the closing ). E.g.
test({
firstname: firstname({ userid: 12 }),
lastname: lastname({ userid: 12 })
});
In the example above firstname and lastname is matched and the resulted matched string shoud be firstname({ userid: 12 })and lastname({ userid: 12 }).
Don't over-complicate yourself trying to parse that with regex alone. You may use them to aid you, but not for doing all the work.
For example, try using \b[a-zA-Z]+\({ (or even \b[a-zA-Z]+\s*\(\s*{ if your code isn't as clean as the example you put here) to match every function call, and then iterate the results to find those that don't call test.