I am trying to match a function call using Regex but is not giving on big JS file where nested calls of the same function are inside. For example below is the code in JS file
abc('hello', function(){ abc('hello1', function(){ abc('hello2', function() { // Does some! }); }); }); And I want to match only first call to identify the first parameter. The end result I am looking for is hello. So doing like below to match first call
.replace(/(?:\r\n|\r|\n)/g, '').match(/abc\s*[^\"\']*\"([^\"\']*)\"/); Any suggestions please?