Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2006

Tip: Looking for answers? Try searching our database.

Struts - validating foreign characters

Thread view: 
mdjj - 31 Mar 2006 11:56 GMT
I need to validate my web app to allow both english and european
characters (anything else I'll reject). I can do it by allowing
individual characters in the mask i.e.

>From validation.xml :

<constant>
  <constant-name>alphaForeignCheck</constant-name>
  <constant-value>^[a-zA-Z  è\s]*$</constant-value>
</constant>

This will allow for alphas and è. But rather than list individual
foreign characters is there a way to group say all french all german
characters?
Oliver Wong - 31 Mar 2006 18:55 GMT
> I need to validate my web app to allow both english and european
> characters (anything else I'll reject). I can do it by allowing
[quoted text clipped - 10 lines]
> foreign characters is there a way to group say all french all german
> characters?

Unicode code charts are at: http://www.unicode.org/charts/

You'll probably want \u00c0 to \u00FF, except not \u00f7 and \u00d7. You
might want to also look at Latin Extended A and Latin Extended B.

Perhaps you can save yourself a lot of effort and do the validation in Java,
via Character.isLetter()

   - Oliver


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.