Created
July 9, 2014 06:31
-
-
Save azeemhassni/65cf74ed57b8b86dc3fe to your computer and use it in GitHub Desktop.
Select IF Block using Regular Expressions
This file contains 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 | |
$pat = 'if\(.*\)\s?\{\n?(.*\s\n?)+\}' | |
$matches = array(); | |
$code = 'if($var != $var2) { | |
// code | |
}'; | |
$isFound = preg_match($pat,$code,$matches); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment