I'm scripting something to replace column names based on a regex match. I iterate through all columns and regex regex match with a new string. Works well and handy for shortening col names - except when I am replacing to a string that starts with a number - this is because the backreference gets messed up (\1 becomes \133 in the case below)
In python, there is 'unambious backreference' to work around this. Is there the same in JSL? I read somewhere maybe it uses Perl type backreferences but couldn't find where this is documented.
Thanks,
Peach
colName = "COLUMNNAMETEST LONGNAMESHORTEN33339E0HS KEEPTHIS";
Rename_regx = "LONGNAMESHORTEN2339E0HS111";
Rename_to = "39E0H";
newname=Regex( colName,
"(.*?)(" || Rename_regx || ")(.*)", // match
"\1" || Rename_to || "\3") // replace match with
// "\g<1>" || Rename_to || "\g<3>") // python like unambiguous doesn't owrk