Reputation: 33
I need to use <
character in a regular expression,
"^[a-zA-Z0-9>_/.\<-]*$"
This pattern is supposed to match alphanumeric characters and > _ / . -
However, I cannot use <
character in it.
I tried \<
but it did not work.
Upvotes: 2
Views: 1009
Reputation: 626738
Inside an XML attribute, you need to use XML entities for < and >.
This is a variant with just a lessthan sign
<f:validateRegex pattern="^[a-zA-Z0-9<_/.-]*$"/>
This will match both greaterthan and lessthan signs
<f:validateRegex pattern="^[a-zA-Z0-9><_/.-]*$"/>
Upvotes: 1