What's a character?
String test = " !a b 23455";
if (test.matches("\\p{Alnum}+")) {
System.out.println("Yes");
} else {
System.out.println("Yes");
}
Kaj
I am not sure what you mean by validating in this case but here is a method that might help. In this example you use regular experssions to find a particular subString in a String.
Example:
String greatings = "Hello World! and Happy World!";
IsPattern("Happy", greatings);
where greatings "IsPattern" function is:
private boolean IsPattern(String aSearch, String aPropert) {
aSearch = aSearch.replaceAll("\\*", ".*");
Pattern patern = Pattern.compile(aSearch);
CharSequence input = aPropert;
Matcher match = patern.matcher(input);
return match.find();
}
The return value is true in this example.
I hope this helps.
BD.