Jump to content

Change it to

Pattern pattern = Pattern.compile('{}";');

EDIT: full explanation

You start a string with the first ", then you stop it with ", then follows a semicolon which is unexpected because the closing bracket of your method call hasn't been entered yet. The next this is another ", which starts a new string and contains the closing bracket and the semicolon you actually want. Changing the outer most " to a single ' solves the problem because the string won't end end when it encounters a ".

 

I hope this makes even a bit of sense :)

Link to comment
https://linustechtips.com/topic/145194-java-characters/#findComment-1938718
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×