package app;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class ValidIdentifierDemo
{
public static void main(String s[])
{
Pattern p=new Pattern.compile("[a-z A-z][a-z A-Z 0-9]+"); //error here
Matcher m=p.matcher("int");
if(m.find()&&m.group().equals(s[0]))
{
System.out.println("Valid");
}
else
{
System.out.println("InValid");
}
}
}
Aucun commentaire:
Enregistrer un commentaire