This tip shows the way to validate a string with respect to a regular expression. java.util.regex package is used for regular expression related operations.
In this example the input string (inputStr) is validated with the regular expression (rgString).