Skip to content

Instantly share code, notes, and snippets.

@farvisun
Created May 13, 2019 05:00
Show Gist options
  • Save farvisun/de113359c888946da1cf735972ed27a1 to your computer and use it in GitHub Desktop.
Save farvisun/de113359c888946da1cf735972ed27a1 to your computer and use it in GitHub Desktop.
Tag regex with persian characters
<?php
$text = '#سلام_دنیا';
if(preg_match('/\#([א-תآ-یÀ-ÿ一-龥а-яا-یa-z0-9\-_]{1,50})/iu',$text)){
echo $text ." is tag\n";
}else{
echo $text ." is not tag\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment