Extract words from string with preg_match_all

前端 未结 7 2266
你的背包
你的背包 2020-12-21 17:14

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

7条回答
  •  执念已碎
    2020-12-21 17:57

    Try this one:

    $str='Sus azahares presentan gruesos pétalos blancos teñidos de rosa o violáceo en la parte externa, con numerosos estambres (20-40).';
    preg_match_all('/([^0-9\s]){4,}/i', $str, $matches);
    echo '
    ';
    var_dump($matches);
    echo '
    ';

提交回复
热议问题