You can concatenate simple regular expressions into complex search criteria to validate against complex patterns, such as any of several words with different endings.

regular expression for validating special characters-23

There is no match in the string 'Grab crab' because while it contains the substring 'ab c', it does not contain the exact substring 'abc'.

When the search for a match requires something more than a direct match, such as finding one or more b's, or finding white space, the pattern includes special characters.

This chapter describes Java Script regular expressions.

You construct a regular expression in one of two ways: Using a regular expression literal, which consists of a pattern enclosed between slashes, as follows: Regular expression literals provide compilation of the regular expression when the script is loaded.

For information on regular expressions used in Cold Fusion functions, see Using Regular Expressions in Functions.

Because special characters are the operators in regular expressions, to represent a special character as an ordinary one, escape it by preceding it with a backslash.If the regular expression remains constant, using this can improve performance.Or calling the constructor function of the Using the constructor function provides runtime compilation of the regular expression.The Cold Fusion server evaluates the variables and functions before the regular expression is evaluated.For example, you can validate against a value that you generate dynamically from other input data or database values.A backslash that precedes a special character indicates that the next character is not special and should be interpreted literally.