Java Regex or Regular Expression in java

Regular Expression used to define constraint on strings such as password and email validation.