Bean validation regex for an input string containing x or y number of digits
<p>I want to check if an input string contains x or y number of digits. I am using <code>JSR-303</code> bean validation. Is it possible to check? If yes what regex would be appropriate? For. eg. "123dfn5657" or "34fdg8959413" if validating against something like "^(\d{7}|\d{9})$" should be valid.</p>