- or download this
$ perl -le 'print "ok" if ("我走" =~ m/\w+/)'
$ perl -le 'print "ok" if ("hi" =~ m/\w+/)'
ok
- or download this
$terms =~ s/($word)\p{IsSpace}*($word)/$1 AND $2/g for 1..2;
- or download this
$terms =~ s/(\p{IsSpace}/ AND /g;