ここで、この赤ちゃんをお試しください:
preg_match_all('/[\p{L}\p{M}]+/u', $subject, $result, PREG_PATTERN_ORDER);
for ($i = 0; $i < count($result[0]); $i++) {
# Matched text = $result[0][$i];
}
マッチ言葉としてのアクセントを持つすべての可能な文字を:
"
[\p{L}\p{M}] # Match a single character present in the list below
# A character with the Unicode property “letter” (any kind of letter from any language)
# A character with the Unicode property “mark” (a character intended to be combined with another character (e.g. accents, umlauts, enclosing boxes, etc.))
+ # Between one and unlimited times, as many times as possible, giving back as needed (greedy)
"
See it.
何あなたの文字列はのようなもので、どのような文字セットを使っていますか。 –
どのように\ b単語の境界 –
私はutf-8を使用しています! – ragnarius