I am trying to write regular expression . The requirements are: the expression should be written in cyrilic alphabet also it can contains any numbers and any symbols like !@#$%^&*() and so on only latin letters are excluded. My problem is that my expression doesn't include all these paticular symbols like !@#$... my expression is ^[а-яА-ЯёЁa0-9]+$. I do Test :
@Test
public void matchAnEmptyStringOrASpecificOtherPattern() {
String input = "";
// ^[а-яА-ЯёЁa0-9]+$
assertTrue( Pattern.compile("^[а-яА-ЯёЁa0-9]+$").matcher(input).find()
);
How to include these symbols in my pattern .
Aucun commentaire:
Enregistrer un commentaire