/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
String[] tests
= { "href=\"asdasda.html\"",
"href=\"asdasda.ht\"" }; Pattern pattern = Pattern
.compile("href\\s*[=]\\s*\"(?!.+?[.]htm[l]?\")(.+?)\"");
Matcher matcher = pattern.matcher(test);
if (matcher.matches()) {
System.
out.
format("'%s' matches! (%s)%n", matcher.
group(), matcher.
group(1)); } else {
System.
out.
format("'%s' doesn't match!%n", test
); }
}
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CmltcG9ydCBqYXZhLnV0aWwucmVnZXguTWF0Y2hlcjsKaW1wb3J0IGphdmEudXRpbC5yZWdleC5QYXR0ZXJuOwoKLyogTmFtZSBvZiB0aGUgY2xhc3MgaGFzIHRvIGJlICJNYWluIiBvbmx5IGlmIHRoZSBjbGFzcyBpcyBwdWJsaWMuICovCmNsYXNzIElkZW9uZQp7CglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbiAoU3RyaW5nW10gYXJncykgdGhyb3dzIGphdmEubGFuZy5FeGNlcHRpb24KCXsKCQlTdHJpbmdbXSB0ZXN0cyA9IHsgImhyZWY9XCJhc2Rhc2RhLmh0bWxcIiIsICJocmVmPVwiYXNkYXNkYS5odFwiIiB9OwoJCVBhdHRlcm4gcGF0dGVybiA9IFBhdHRlcm4KCQkJCS5jb21waWxlKCJocmVmXFxzKls9XVxccypcIig/IS4rP1suXWh0bVtsXT9cIikoLis/KVwiIik7CgkJZm9yIChTdHJpbmcgdGVzdCA6IHRlc3RzKSB7CgkJCU1hdGNoZXIgbWF0Y2hlciA9IHBhdHRlcm4ubWF0Y2hlcih0ZXN0KTsKCQkJaWYgKG1hdGNoZXIubWF0Y2hlcygpKSB7CgkJCQlTeXN0ZW0ub3V0LmZvcm1hdCgiJyVzJyBtYXRjaGVzISAoJXMpJW4iLCBtYXRjaGVyLmdyb3VwKCksIG1hdGNoZXIuZ3JvdXAoMSkpOwoJCQl9IGVsc2UgewoJCQkJU3lzdGVtLm91dC5mb3JtYXQoIiclcycgZG9lc24ndCBtYXRjaCElbiIsIHRlc3QpOwoJCQl9CgkJfQoJfQp9