jeudi 7 juillet 2016

Need Regular expression for Java

In a big text field I want to check if it has below pattern

or 1=1
or 1 = 1
or 2 = 2 
or 3 = 3 
or 2=2

what I have done so far is taken string and removed all whitespace and converted to lowercase as shown below.

String LV_TMP = mystring.getText().replaceAll("\\s+", " ").toLowerCase();

what shall be regular expression to check for the pattern I have given above.

Aucun commentaire:

Enregistrer un commentaire