Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. <?php
  2.  
  3. $re = '/(?<=<@!).+?(?=>)/m';
  4. $str = '<@!123456789>';
  5.  
  6. preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
  7.  
  8. // flatten the array result (otherwise it's an array of arrays)
  9. $matches = array_merge(...$matches);
  10.  
  11. // Print the entire match result
  12. print_r($matches); //Array ( [0] => 123456789 )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement