fork(1) download
  1. <?php
  2.  
  3. $re = '/#\w+/u';
  4. $str = "This is my testing string, look at the hashtags and see that the multibyte ones are ignored. #php #regex #my #multibyte #åäö #öl #läsa #drickaöl #tags #are #being #ignored";
  5. preg_match_all($re, $str, $matches);
  6. print_r($matches[0]);
Success #stdin #stdout 0.02s 24192KB
stdin
Standard input is empty
stdout
Array
(
    [0] => #php
    [1] => #regex
    [2] => #my
    [3] => #multibyte
    [4] => #åäö
    [5] => #öl
    [6] => #läsa
    [7] => #drickaöl
    [8] => #tags
    [9] => #are
    [10] => #being
    [11] => #ignored
)