Forum Moderators: coopster & phranque

Message Too Old, No Replies

Matching word characters

International support

         

DrDoc

7:11 am on Mar 24, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If I use \w it matches most "common" international letters, such as ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜ...

However, there are several other common letters that aren't matched. So, how do I go about matching as many as possible without having to add them all to a variable/array?

I have several text fields where the user can enter a name, and I expect lots of international visitors. So, either I limit it to just A-Z (which I don't want to do), or I include as many as possible...

I understand that it's impossible to include all valid letters, but I'd like to cover as many as possible.

I'm thankful for any pointers/suggestions/examples...

andreasfriedrich

11:15 am on Mar 24, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



[url=http://www.perldoc.com/perl5.8.0/pod/func/use.html]use[/url] [url=http://www.perldoc.com/perl5.8.0/lib/locale.html]locale[/url]; [url=http://www.perldoc.com/perl5.8.0/pod/perllocale.html#The-setlocale-function]setlocale[/url];
lets you adjust what Perl [perl.com] considers a word character. There is an example in the Perl [perl.com] docs I linked to.

HTH Andreas

DrDoc

12:13 pm on Mar 24, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Maybe I should've specified that this has to be done in PHP ;)

Besides, I can't really set the locale... since I don't know what kind of locale would best match the user input...