Hi,
I am trying to match a string like this: test (AB12 A)
including the brackets.
So far, I have this code:
As you may have guessed...it doesn't work. What am I doing wrong ? Am I right with the two backslashes to match a bracket and with the /s to match a blank space ?
thanks !
I am trying to match a string like this: test (AB12 A)
including the brackets.
So far, I have this code:
Code:
Pattern p = Pattern.compile("[A-Z]+/s+\\([A-Z]{2}[0-9]{2}/s+[A-Z]{1}\\)");
Matcher m = p.matcher(string to match in here);
boolean b = m.matches();
if(b){
System.out.println("match seen");
}else{
System.out.println("Not a match");
}
thanks !
Comment