So, if I want to replace b[anything here] in a string with f[same thing here] how would I do that? Example:
What is a regular expression that would make foobarfoo to foofarf
Put the portion of interest inside parentheses in the regular expression. It can then be referenced by its group number in replacement text, or via the Matcher.group() method.