Re: preg for unicode strings?

From: Date: Mon, 07 Nov 2005 04:08:19 +0000
Subject: Re: preg for unicode strings?
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-225219@lists.php.net to get a copy of this message
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?

« previous php.general (#225219) next »