regex to add a variable to calls

Dr. Hawkins dochawk at gmail.com
Fri Sep 16 18:13:36 EDT 2016


As I move to multiple open debtors, I'm having small but consistent and
numerous changes.

I need to catch every instance of


getVal(a,b,c)


and change them to

getVal(a,b,c,dbtr)

(and similarly to find when called with one or two arguments)

a can actually be a combination of letters and numbers (a variable
name)--but might be an expression to produce this.

b should only be empty or "D", "T", and one other like that, and c will be
a variable that evaluates to a number.

dbtr is the variable name I want to pass.

Even catching most, and inspecting before tapping replace, would be a huge
timesaver.

I don't remember enough regexes to make this work with the parens.

I'm thinking a search term of

getVal\(([a-z1-9A-Z]+,[a-z1-9A-Z]+,[a-z1-9A-Z]+)\)


and

getVal($1,dbtr)


as replace, but this isn't right.

Can anyone help?

Thanks
-- 
Dr. Richard E. Hawkins, Esq.
(702) 508-8462



More information about the use-livecode mailing list