First page Back Continue Last page Graphics

Using Declarative Built-in Rules: Regular Expression Validator


Using a Regular Expression Validator

Regular expressions provide a powerful syntax that enables matching strings with particular characters, words, or patterns of characters. This syntax can be quite complex and is outside the scope of this course. To learn about regular expressions, you can visit http://www.regular­, or explore the Java tutorial at

The Regular Expression validator compares attribute values against a mask specified by a Java regular expression. This type of validator enables you to provide a dynamic script for more complex validation rules.

Instead of defining an expression in this validator, you can choose from a list of predefined expressions. The built-in predefined expressions include telephone number and email address. You can add your own expressions to this list by modifying the file. This file is located in the o.BC4J subdirectory of the JDeveloper system directory (system11.1.1.0.xx.xx.xx), which is a subdirectory of JDeveloper’s user directory.

When you use a Regular Expression validator, a <RegExpValidationBean> tag is added to the XML file.