find all numeric mix words


import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class MixWords {
public static void main(String[] args) {
       

String pattern="(.*)\\d(.*)";

String text="deep deep44 44deep de44ep";

Pattern p=Pattern.compile(pattern);
    
String tt[]=text.split("\\s");
 
for(int i=0;i
Matcher m=p.matcher(tt[i]);
System.out.println(m.matches()+"\t"+tt[i]);
}
}
}

Output is :- 

false deep
true        deep44
true        44deep
true       de44ep

No comments: