Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $re = '/(?<=<@!).+?(?=>)/m';
- $str = '<@!123456789>';
- preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
- // flatten the array result (otherwise it's an array of arrays)
- $matches = array_merge(...$matches);
- // Print the entire match result
- print_r($matches); //Array ( [0] => 123456789 )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement