mentions with PHP implode

Hi,This code creates a friendly link on user mentions in comments...

However, it is not case sensitive and vice versa.

Examples;

@test works
@Test doesn't work

The regular expression takes both values. But the query is not catching. I figured it would be a case-sensitive collation on the database. But I am using utf8_general_ci (users) & utf8_unicode_ci (comments)... I tried changing it to utf8mb4_bin, but it's still the same. The same (user mentioned) only because of a lowercase / or uppercase letter it doesn't work ;/
What do I do?