I am working on a project and I can't figure out how to go about doing it. I'm trying to do with Regex but fairly new to it.
I have a string such as WHERE MyColumn='1's'' AND MyColumn='Test's''"
I have the following regex in PHP
$found = array();
preg_match("/\s=\s'.*'|\s.*='.*'\s/", $whereQuery, $found);
In my array I have the following
Array
(
[0] => MyColumn='1's''
)
So it's almost there, except I am expecting the following:
Array
(
[0] => MyColumn='1's''
[1] => MyColumn='Test's'
)
preg_matchonly return first match. If want multiple matches, usepreg_match_all.