Reply to Re: [PHP] preg for unicode strings?

Your name:

Reply:


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?

[Back to original 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

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