Is there a way to refer back to the search statement in the replace statement of the replaceAll() function?
For example, I want to search (case-insensitive) for "abc" in a given string and replace it by "<0>" + found string + "<0>":
- "xxABCyy".replaceAll( "(?i)(abc)", "<0>\1<0>" ) ---> returns "xx<0>ABC<0>yy"
- "xxabcyy".replaceAll( "(?i)(abc)", "<0>\1<0>" ) ---> returns "xx<0>abc<0>yy"
In other programming languages this is realized by creating a capturing group using round brackets and referening back to it using \1 (as I did above).
In addition, is it possible to refer back to the whole found string (as is done by using \0 in other languages)?