There are java specific operators that match letters:
\p{javaLowerCase}
\p{javaUpperCase}

So to make sure a string only contains letters (in any language) you could do 
this:

^[\p{javaLowerCase}\p{javaUpperCase}]+$


If you're using Eclipse you might find this plugin handy, it allows you to test 
regular expressions with ease:
http://bastian-bergerhoff.com/eclipse/features/web/QuickREx/toc.html
http://bastian-bergerhoff.com/eclipse/features/web/installation.html

Martin

On Mon, 21 Sep 2009 00:33:11 +0200, Madtyn <mad...@gmail.com> wrote:

Hello!

I have some doubts about the regexp validators in Tapestry. I have
learnt some about regexp but after making some validating with
success, I haven't been able to do two things:

1) Which flavour of regexp does Tapestry use? I have looked for it on
the Internet but I couldn't find out. I know that there are the regexp
from Javascript, Jakarta and many others but I don't know which one of
them Tapestry's belongs to.

2) Because of the former, I can't make a correct regexp for name and
surname fields. I've tried the following:

nombre-regexp=^([a-zÑñA-Z _.-])+         // This is the name
apellidos-regexp=^([a-zÑñA-Z _.-])+       // This is the surname

   I'm trying to avoid all characters which are not letters, (you
shouldn't have a name containing numbers, dots....) but this is the
more accurate I got and allow numbers (not at the beginning) and it's
not what I want.

   Maybe some spanish Tapestry experts around here could help me with
getting the 'ñ' spanish letter into the regular expressión, as well as
accents.


Thank you very much on advance.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to