I have a text of js File. I want to find all name of function(e.g "destroy","create") but i want to find only "first" level of functions - "close: function " or "success: function" should not be matched. My regex: \,+\s+(\S+:)\s+function For now i found all function names. Please help me with my regex.
(function () {
Create("object", {
customProperty: {
a: 1,
b: 2
},
property1: 1,
property2: 2,
init: function () {
},
listeners: {
close: function (a, b) {
return 1;
}
}
destroy: function () {
},
create: function () {
request({
success: function (response, record) {}
});
}
}
}
).call(this);