Suddenly, it was necessary to cut out Chinese characters from text files and save them to another file. It seems nothing complicated, but I still do not understand how to set the range of simplified hieroglyphs in a regular expression.

  • The idea is simple - take on a range of Unicode. Try the options from here - gbg
  • one
    it would be nice to add the label of the language in which you use regular expressions - sercxjo
  • PHP: preg_replace_callback('~\p{Han}+~', function($m) use($filename) { savetofile($m[0], $filename); return ''; }, $str); - Wiktor Stribiżew

0