Match
This conditional tag can be used where you would use any of the
other conditional tags such as eq, neq, etc. The only difference
is that this tag allows you validate that a given property
respects a specified regular expression. The regular expression
syntax can be found at
Java Regular Expression.
Required Attributes
source
The value to validate that respects the specified regular
expression.
expression
The regular expression to use when validating the source
attribute.
Usage Examples
Example #1
<if>
<match expression="[^@]+@.+" source="user@host" />
<then>
<log>Using user authentication method</log>
</then>
</if>
Example #2
<if>
<match expression="(h|H)(t|T)(p|P)(s|S)?:/{1,3}[^:]:+[^@]+@[^/]/.+" source="http://user:password@host/path" />
<then>
<log>Validated it looks like any http/https url</log>
</then>
</if>
Example #3
<if>
<match expression="http\:\/" partial="true" source="http://user:password@host/path" />
<then>
<log>Looks like an HTTP url</log>
</then>
</if>