import java.util.regex.Matcher;
import java.util.regex.Pattern;
class TestClass {
private static final Pattern MY_PATTERN = Pattern.compile("my|regex");
public static void main
(final String args
[]) { final StringBuilder builder = new StringBuilder("This is my, not your, regex!");
final Matcher m = TestClass.MY_PATTERN.matcher(builder);
builder.replace(0, builder.length(), m.replaceAll("<b>$0</b>"));
}
}
aW1wb3J0IGphdmEudXRpbC5yZWdleC5NYXRjaGVyOwppbXBvcnQgamF2YS51dGlsLnJlZ2V4LlBhdHRlcm47CgpjbGFzcyBUZXN0Q2xhc3MgewoJCiAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBQYXR0ZXJuIE1ZX1BBVFRFUk4gPSBQYXR0ZXJuLmNvbXBpbGUoIm15fHJlZ2V4Iik7CiAgICAKICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKGZpbmFsIFN0cmluZyBhcmdzW10pIHsKICAgICAgICBmaW5hbCBTdHJpbmdCdWlsZGVyIGJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigiVGhpcyBpcyBteSwgbm90IHlvdXIsIHJlZ2V4ISIpOwogICAgICAgIAogICAgICAgIGZpbmFsIE1hdGNoZXIgbSA9IFRlc3RDbGFzcy5NWV9QQVRURVJOLm1hdGNoZXIoYnVpbGRlcik7CiAgICAgICAgYnVpbGRlci5yZXBsYWNlKDAsIGJ1aWxkZXIubGVuZ3RoKCksIG0ucmVwbGFjZUFsbCgiPGI+JDA8L2I+IikpOwogICAgICAgIAogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbihidWlsZGVyKTsKICAgIH0KICAgIAp9Cg==