You can either use one of the predefined expressions such as the "Email" regular expression or the "Phone" regular expression to validate whether a specific attribute conforms to a specific pattern.
For example, ensure that an email consists of a specific number of predefined characters followed by the "at sign" (@) followed by a specific number of predefined characters followed by the "dot character" (.) followed by a specific number of predefined characters.
So let's see how we can use one of the predefined regular expressions, how you can create your own regular expression and how you can register your custom expressions for re-usability.
For the purpose of demoing the "Regular Expression" validator I have created an ADF Fusion Web Application and created the basic business components that I will be using in this demo; an entity object based on the Employees HR table, a default view object based on the Employees entity object and a default application module.
In the “Type” combo select “Regular Expression”, select the attribute that you want to define the validator, in my demo it's the "Email" attribute and then select an operator, either "Matches" or "Not Matches". In my demo I have selected the "Matches" operator.
Under the regular expression section you can either select one of the predefined expressions (currently two, "Email" and "Phone Number(US)") or type your own regular expression. I've selected the "Email" regular expression and clicked on the "Use Pattern" button to generate the pattern.
You can of course create your own custom regular expressions. As with the example below, I have defined a regular expression to ensure that an employee's first name consists of only alpha characters and that the first name always starts with an upper case.
A much better approach would be to register your custom regular expression into the PredefinedRegExp.properties file and your custom regular expression will appear into the list of "Predefined Expressions". This file is located in the o.BC4J subdirectory of the JDeveloper system directory (in my case it's system22.214.171.124.41.140521.1008), which is a subdirectory of JDeveloper’s user directory (the file in my case is located in "/home/oracle/apps/.jdeveloper/system126.96.36.199.41.140521.1008/o.BC4J").
Edit the file and add your own custom regular expression.