Can I use parenthesized substring matches from a regular expression?
I would like to use pieces of string that matches regular expression parenthesized groups, like this:
- reg_ex = "(.*)([A-Za-z}{3})(.*)";
- if (mystring.matches(reg_ex)
- {
- mystring = mystring.replaceAll(reg_ex, "\2");
- }
Is it possible?