Hello everyone, the problem is as follows: when using the pattern in the matches () method, in error it shows the last character

enter image description here

if(scanLine.matches( "^((LABEL ([az]([[az]|[\\d])|\\d{0,4}))(, ([az]([[az]|[\\d])|\\d{0,4}))*)$")) System.out.println("Строка записана правильно"); 

1 answer 1

I think it would be better:

 "^((LABEL ([az]([az]|[\\d])|\\d{0,4}))(, ([az]([az]|[\\d])|\\d{0,4}))*)$" 

it is not clear why double brackets are used twice