求正则匹配tab, \t貌似也会匹配空格呢
求正则匹配tab, \t貌似也会匹配空格呢
$s = ' '; //一个空格加一个制表符<br />echo current(unpack('H*', $s)); //2009 20是空格的十六进制内码,09是Tab键的十六进制内码<br /><br />preg_match("/\t+/", $s, $r);<br />echo current(unpack('H*', $r[0])); //得到 09<br /><br />preg_match("/ +/", $s, $r);<br />echo current(unpack('H*', $r[0])); //得到 20<br /><br />preg_match("/\s+/", $s, $r);<br />echo current(unpack('H*', $r[0])); //得到 2009<br />