struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alvin Townsend Jr." <al...@speakeasy.net>
Subject Re: [validator-plugin] MASK_VALIDATOR
Date Tue, 01 Jun 2004 22:45:04 GMT
Hi Matthias,

I believe that the ^ and $ in a regular expression pattern are used to symbolize the start
and end of the evaluated string. Thus:

^a means the string must begin with an a,
a$ means the string must end with an a.

Struts may handle regex differently, but if you remove them, it will only change the pattern
which is matched. I could be wrong about this, but I'll give it a go:

^[a-zA-Z]*$ - requires a string of zero or greater length that starts with, ends with, and
contains only a-z and A-Z (that is if there are characters))

[a-zA-Z]* - basically says that if the string length > 0, it must have a-z or A-Z somewhere
in it.

My $.02,

Alvin

> -----Original Message-----
> From: Matthias Wessendorf [mailto:mailings@matthias-wessendorf.de]
> Sent: Tuesday, June 1, 2004 09:08 PM
> To: dev@struts.apache.org
> Subject: [validator-plugin] MASK_VALIDATOR
> 
> Hi there,
> 
> what is the reason, the mask need to start with "^"
> and end with "$" ?
> 
> -->
> <var-name>
>   mask
> </var-name>
> <var-value>
> ^[a-zA-Z]*$
> </var-value>
> 
> possible to turn off?
> 
> Cheers,
> --
> Matthias We├čendorf
> Aechterhoek 18
> D-48282 Emsdetten
> Email: matthias AT wessendorf DOT net
> URL: http://www.wessendorf.net
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
> 
> 





---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Mime
View raw message