SHARE
TWEET

Untitled

a guest Jun 18th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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 )
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top