You are here: Re: [PHP] preg for unicode strings? « PHP « IT news, forums, messages
Re: [PHP] preg for unicode strings?

Posted by Niels Ganser on 11/07/05 06:08

Andy,

try that one: /^[a-zA-Z]{3}|\p{Sc}$/u

You don't want to put \p{Sc} in square brackets as \p{Sc} itself already
is a character class. Umm.. Kinda don't make myself clear here, do I?
You just don't want to, it's 5am in the morning here I gotta go to the
next bed ;p

Regards,
Niels



Andy Pieters:
> Hi
>
> Thank you for your reply.
>
> My regexp was
>
> /^([a-zA-Z]{3,}|[\W])/
>
> Meaning match any string that is either
> 3 letters
> or
> 1 word character
>
> I'd like to change this to
> 3 letters
> or
> 1 currency character
>
> So I changed the regexp accordingly
> /^([a-zA-Z]{3,}|[\p{Sc}])/u
>
> And I tested with £
>
> but it fails.
>
> Any ideas?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация