0

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/

3
  • Does it work if you use a range of non-Cyrillic characters? It could be that PHP doesn't understand ranges outside the Latin alphabet. Commented Jul 25, 2013 at 14:06
  • You just flipped two characters \([а-яА-Я ]+\). Commented Jul 25, 2013 at 14:08
  • I am not sure but i think it accepts non-latin chars Commented Jul 25, 2013 at 14:08

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

1 Comment

This is working and is possible solution for now thank you Teneff :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.