import java.util.regex.Matcher;
import java.util.regex.Pattern;
class Foo {
public static void main
(String[] args
) { Matcher m = Pattern.compile(".*(?<=X)").matcher("Foo BarX Baz");
// limit matcher to first chars outside of normal lookahead scope
m.region(0, 4);
// matcher should still find a match because of transparent bounds
m.useTransparentBounds(true);
System.
out.
println("found=" + m.
find()); System.
out.
println("result=" + m.
group()); }
}
aW1wb3J0IGphdmEudXRpbC5yZWdleC5NYXRjaGVyOwppbXBvcnQgamF2YS51dGlsLnJlZ2V4LlBhdHRlcm47CiAKY2xhc3MgRm9vIHsKICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKFN0cmluZ1tdIGFyZ3MpIHsKICAgICAgICBNYXRjaGVyIG0gPSBQYXR0ZXJuLmNvbXBpbGUoIi4qKD88PVgpIikubWF0Y2hlcigiRm9vIEJhclggQmF6Iik7CiAKICAgICAgICAvLyBsaW1pdCBtYXRjaGVyIHRvIGZpcnN0IGNoYXJzIG91dHNpZGUgb2Ygbm9ybWFsIGxvb2thaGVhZCBzY29wZQogICAgICAgIG0ucmVnaW9uKDAsIDQpOwogCiAgICAgICAgLy8gbWF0Y2hlciBzaG91bGQgc3RpbGwgZmluZCBhIG1hdGNoIGJlY2F1c2Ugb2YgdHJhbnNwYXJlbnQgYm91bmRzCiAgICAgICAgbS51c2VUcmFuc3BhcmVudEJvdW5kcyh0cnVlKTsKICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oImZvdW5kPSIgKyBtLmZpbmQoKSk7CiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJyZXN1bHQ9IiArIG0uZ3JvdXAoKSk7CiAgICB9Cn0=