fork download
  1. <?php
  2.  
  3. $re = '~^https?://(www\.)?twitter\.com/(#!/)?@?(?<name>[^/]+)(/\w+)*$~';
  4. $str = 'https://t...content-available-to-author-only...r.com/#!/@tweet';
  5. if (preg_match($re, $str, $m)) {
  6. echo $m['name'];
  7. }
Success #stdin #stdout 0.02s 23888KB
stdin
Standard input is empty
stdout
tweet