How to get substring from Indesign grep search
Hi,
Can anybody tell how to extract substring from grep search.
For example, here is my JS code:
app.findGrepPreferences = null;
app.findGrepPreferences.findWhat = "\\{\\{(artref|boxref|tableref) (.+)( ?)(.+)?\\}\\}";
found = app.activeDocument.findGrep ();
for (i = 0; i<found.length; i++)
{
here I want to save the string "$2" in to some variable.
}
From the above script, I want to save second pattern match ($2 value) to another variable.
Thanks,
Gopal