|
Regular expressions are strings (or patterns) that
match a set of strings or patterns. For example, it
is possible to write regular expressions that match all email addresses,
alphabetic characters only, or even IP addresses.
The Enterprise Gateway can use such regular expressions to ensure that HTTP header
values and/or query string attribute values conform to configured
patterns. For example, it is possible to configure a regular expression
to make sure that the value of a "User" HTTP header or a "User" query
string attribute is a valid email address. To illustrate this, let's
look at how the regular expression can be applied to both cases:
HTTP Header:
|
| | |
|
POST /services/getEmployee HTTP/1.1
Content-Type: text.html
User: user@oracle.com
| |
| | |
|
Query String:
|
| | |
|
http://hostname.com/services/getEmployee?User=user@oracle.com
| |
| | |
|
The following regular expression can be used to ensure that both the
header and attribute values conform to the standard email format:
|
| | |
|
\b[a-zA-Z0-9._%-]+@[a-zA-Z0-9._%-]+\.[a-zA-Z]{2,4}\b
| |
| | |
|
To learn how to configure regular expressions for the respective request
parameters, click on the appropriate link below:
|