Basically I translated a string from english to japan like this:
$test1 = 1104 Notes receivable
$test2 = 1104 受取手形
My Goal is to remove the number on front of string. I use this regeX:
preg_replace('/^[^A-Za-z]+/', '', $test1)
output : Notes receivable
Now , how about the japanese ? I need this string : 受取手形
^\P{L}+
<?php
$strings = ["1104 Notes receivable", "1104 受取手形"];
foreach($strings as &$string) {
$string = preg_replace('/^\P{L}+/', "", $string);
}
var_dump($strings);
^
Assert position at the start of the line.\P{L}+
Matches any character that \p{L}
does not (equivalent to [^\p{L}]
), one or more times. \p{L}
is a Unicode character class that matches any letter in any language/script.