regexp with russian lang

前端 未结 3 1830
别那么骄傲
别那么骄傲 2020-12-08 23:41

I can\'t solve my problem with regexp.

Ok, when i type:

$string = preg_replace(\"#\\[name=([a-zA-Z0-9 .-]+)*]#\",\"$name_start $1 $name_end\",$string         


        
3条回答
  •  感动是毒
    2020-12-09 00:36

    This one worked for me:

    /^[а-яА-Я\p{Cyrillic}0-9\s\-]+$/ 
    

    I have tested in all the browsers including Safari

提交回复
热议问题