I\'m not good with regex but i want to use it to extract words from a string.
The words i need should have minimum 4 characters and the provided string can
When you use the u
modifier, you can use the following pattern (demo):
preg_match_all('(\w{4,})u', $string, $matches);
print_r($matches[0]);
The u modifier means:
u (PCRE_UTF8): This modifier turns on additional functionality of PCRE that is incompatible with Perl. Pattern strings are treated as UTF-8. This modifier is available from PHP 4.1.0 or greater on Unix and from PHP 4.2.3 on win32. UTF-8 validity of the pattern is checked since PHP 4.3.5.