I am not sure if this is possible to do, but I need a way to replace a value of a numbered group specified in the my regex expression with a string declared dynamically at runtime, once a match has been made.
Given a simple case, something like...
(/)?([A-Za-z0-9])?(/)?$
I would want to be able to plugin a replacement for group 2.
I am current using Java's Matcher class.