简体   繁体   中英

regular expression conversion Javascript to PHP

Hey i have the following regular expression /\\(+[а-яА-Я- \\)]+/ so I need to use it in PHP how to convert it because PHP gives me error

preg_match(): Compilation failed: nothing to repeat at offset 15

I am new to regexp but I don't understand where is the problem and yea those are Cyrylic characters

I need that so I can extract cyrylic characters. You can see that the regexp is working here is a jsfiddle http://jsfiddle.net/xSPZX/

You can try this:

$text = "Mon Jul 01 2013 19:27:19 GMT+0300 (Финландия - лятно часово време)";
echo preg_replace('/\(+\X+\)+/', '', $text);

Some additional info: Unicode character properties

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM