What should be the RegEx if I want to find the text between the phrases " IF (NEW.
" and " !
"?
Likewise I am thinking of the pattern as $pattern = '/(?<= IF (NEW.)[^ !]+/';
I am matching it as
$input = $row4['ACTION_STATEMENT'];`/*BEGIN IF (NEW.name != OLD.name) THEN INSERT INTO jos_menuaudit set menuid=OLD.id, oldvalue = OLD.name, newvalue = NEW.name, field = "name"; END IF; IF (NEW.alias != OLD.alias) THEN INSERT INTO jos_menuaudit set menuid=OLD.id, oldvalue = OLD.alias, newvalue = NEW.alias, field = "alias"; END IF; END*/`
preg_match_all($pattern, $input, $captures);
What if I want $captures as an array, in which all values will be stored which will match with above pattern being in between of this pattern?