Created
December 29, 2015 11:31
-
-
Save degecko/9f9eeb4f522b64cb1996 to your computer and use it in GitHub Desktop.
Match everything but something
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$data = 'This is my data that contains SOMETHING I DON\'T WANT in it.'; | |
preg_match('#^(?:(?!SOMETHING).)*$#', $data, $results); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment