/* package whatever; // don't place package name! */
import java.util.*;
import java.util.regex.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
static Pattern pattAlphaNum = Pattern.compile("[A-Z|a-z|\\d+]");
static Pattern pattAlpha = Pattern.compile("[A-Z|a-z]");
static Pattern pattNum = Pattern.compile("[\\d+]");
static Pattern alternativo = Pattern.compile("([A-Za-z]|\\d+)");
static Pattern semParenteses = Pattern.compile("[A-Za-z]|\\d+");
static void testar
(String s
) { System.
out.
print(s
+ "\t\t\t");
System.
out.
print(pattAlphaNum.
matcher(s
).
matches() + "\t\t"); System.
out.
print(pattAlpha.
matcher(s
).
matches() + "\t"); System.
out.
print(pattNum.
matcher(s
).
matches() + "\t\t");
System.
out.
print(alternativo.
matcher(s
).
matches() + "\t\t"); System.
out.
print(semParenteses.
matcher(s
).
matches() + "\n"); }
{
System.
out.
println("String\t\tAlphaNum\tAlpha\tNum\t\t\tSugestão\tSem Parênteses"); testar("A");
testar("a");
testar("0");
testar("aa");
testar("10");
testar("+");
testar("|");
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS51dGlsLnJlZ2V4Lio7CmltcG9ydCBqYXZhLmxhbmcuKjsKaW1wb3J0IGphdmEuaW8uKjsKCi8qIE5hbWUgb2YgdGhlIGNsYXNzIGhhcyB0byBiZSAiTWFpbiIgb25seSBpZiB0aGUgY2xhc3MgaXMgcHVibGljLiAqLwpjbGFzcyBJZGVvbmUKewogICAgc3RhdGljIFBhdHRlcm4gcGF0dEFscGhhTnVtID0gUGF0dGVybi5jb21waWxlKCJbQS1afGEtenxcXGQrXSIpOwogICAgc3RhdGljIFBhdHRlcm4gcGF0dEFscGhhID0gUGF0dGVybi5jb21waWxlKCJbQS1afGEtel0iKTsKCXN0YXRpYyBQYXR0ZXJuIHBhdHROdW0gPSBQY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