$this->text = trim($text);
$this->tags = $tags;
$this->raw = strtolower(preg_replace('/[^\w]/u', '', $this->text));
- $this->tokens = array_values(array_map('trim', array_filter(preg_split('/\b/', strtolower($this->text)))));
+ $this->tokens = array_values(array_map('trim', array_filter(preg_split('/\b/u', strtolower($this->text)))));
$this->emoteless = $this->text;
if (isset($this->tags['emotes']) && !empty($this->tags['emotes'])) {
$this->emoteless = trim(preg_replace('/\s+/', ' ', $this->emoteless));
}
$this->emoteless_raw = strtolower(preg_replace('/[^\w]/', '', $this->emoteless));
- $this->emoteless_tokens = array_values(array_map('trim', array_filter(preg_split('/\b/', strtolower($this->emoteless)))));
+ $this->emoteless_tokens = array_values(array_map('trim', array_filter(preg_split('/\b/u', strtolower($this->emoteless)))));
}
public static function fromIRC(IRCMessage $msg) {