Reputation: 1825
How to get sql query (second parameter of FORM func)
=FORM("onname", "SELECT "lname", "fname", "year" from table")
I tried with:
.match(/^=FORM\("(.*)", *"((?:.|\n)*)"\)$/i)
but it doesn't work.
Upvotes: 2
Views: 133
Reputation: 9158
See it in action:
^=FORM\(".*?",\s*"(.*)"\)$
Grab 1st capturing group to use.
Upvotes: 0
Reputation: 48817
Here is a very specific to your problem solution:
.replace(/=FORM\("[^"]+", "(.*)"\)/ig, "$1")
Upvotes: 0
Reputation: 91299
var s = '=FORM("onname", "SELECT "lname", "fname", "year" from table")';
var sql = s.match(/^=FORM\("[^"]+", "(.+)"\)$/i)[1];
Upvotes: 3