Simplest validation : Validation « Regular Expressions « Java






Simplest validation

Simplest validation
 

public class ValidationTest {
  public static void main(String[] args) {
    String candidate = "I love Java and Java2s";
    String pattern = "Java \\d";
    System.out.println(candidate.matches(pattern));
  }
}
           
         
  








Related examples in the same category

1.Find duplicationFind duplication
2.Validation with Pattern and MatcherValidation with Pattern and Matcher
3.Perform credit card validations.