import java.util.regex.*;
public class Regex {
public static void main(String[] args) throws Exception {
Pattern p = Pattern.compile("[,\\s]+");
String[] result = p.split("one,two, three four , five");
for (int i=0; i
String textSubject = "aasasa2323";
Pattern brackets = Pattern.compile(".*\\{[h][e][l][l][o]\\}.*");
Matcher fit = brackets.matcher(textSubject);
if (fit.find()) {
System.out.println ("Found");
} else {
System.out.println ("Not found");
}
}
}
No comments:
Post a Comment