Created
May 13, 2019 05:00
-
-
Save farvisun/de113359c888946da1cf735972ed27a1 to your computer and use it in GitHub Desktop.
Tag regex with persian characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode 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