Java regular expression verification