Hi,
I need to get a text which is included inside a defined set of chars. So I thought to use doc.getRange().replace with regular expression to find all phrases matches the regular expression, but how can I get the text inside the regular expression? I can’t find an API to find a text, there’s only the replace one.
Example
I’ve a simple document word whit a phrase like this:
"This is a sample text <<[a.b.c.d.e]>> with a tag
And I need to get
"a.b.c.d.e"
In general, all tokens inside <<[…]>>
Using this code I can find how many tag <<[…]>> are in the document.
int replaced = doc.getRange().replace(Pattern.compile("(<<\\[)[a-zA-Z0-9._]+(\\]>>)"), "replace", new FindReplaceOptions(FindReplaceDirection.FORWARD));
but I can’t find and get a text inside a document.
Thanks