Yii Framework Forum: Regex for Cyrillic characters - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Regex for Cyrillic characters Rate Topic: -----

#1 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 23 July 2009 - 02:56 AM

As we have a lot of russian members here, maybe someone can help: I couldn't find much information wether it's possible to check for cyrillic characters (А-Я) with a regular exp​ression in PHP. Any hints are highly appreciated!

Thanks!
0

#2 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,133
  • Joined: 17-January 09
  • Location:Russia

Posted 23 July 2009 - 08:17 AM

View PostMike, on 23 July 2009 - 02:56 AM, said:

As we have a lot of russian members here, maybe someone can help: I couldn't find much information wether it's possible to check for cyrillic characters (А-Я) with a regular exp​ression in PHP. Any hints are highly appreciated!

Thanks!

Should be А-Яа-я
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#3 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 24 July 2009 - 03:14 AM

Thanks. Did you verify this? I thought there are some problems with UTF-8 + regex. A comment in the PHP manual says, that PCRE functions aren't UTF-8 safe. It states that you can only use mb_ereg* functions and need to alter this:

<?php
  mb_internal_encoding('UTF-8');
  mb_regex_encoding('UTF-8');
  setlocale(LC_ALL, 'fr-fr');

0

#4 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,133
  • Joined: 17-January 09
  • Location:Russia

Posted 24 July 2009 - 03:26 AM

I'm talking about preg_ with unicode modifier, not ereg.
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#5 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 24 July 2009 - 03:30 AM

View Postsamdark, on 24 July 2009 - 03:26 AM, said:

I'm talking about preg_ with unicode modifier, not ereg.


Ah, thanks a lot. Didn't know that one.
0

#6 User is offline   Nemoden 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 68
  • Joined: 14-March 09
  • Location:Vancouver, Canada

Posted 16 August 2009 - 04:47 AM

Maybe this will be useful as well...

Regards.
No brain - no pain.
My twitter :D
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users