SHARE
TWEET

Untitled

a guest Jun 18th, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /((-caramel-)|(-vanilla-)|)/
  2.      
  3. ([carmel-]+)|([vanila-]+)
  4.      
  5. $re = '/([carmel-]+)|([vanila-]+)/m';
  6. $str = '(-caramel-) John Cina (-vanilla-)(-caramel-)2019-05-19 07:31:05(-vannila-)';
  7.  
  8. preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
  9.  
  10. // Print the entire match result
  11. var_dump($matches);
  12.      
  13. <?php
  14. $haystack = '(-caramel-) John Cina (-vanilla-)(-caramel-)2019-05-19 07:31:05(-vannila-)';
  15.  
  16. if (strstr($haystack, '(-caramel-)') && strstr($haystack, '(-vanilla-)')) {
  17.   die('both match');
  18. }
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
 
Top