Hi I am trying to create regex expression and I am running into problems.
Basically this is what I have:
(.+?)(and|or)(.+?)
What I
Try this, but I used explode() method in PHP and not Regex.
The input should have every user on a line, and without parenthesis (you can modify the code to remove the parenthesis), but at least this is the concept.
";
//final array
$result = array();
//separate each line as element in an array
$line = explode("\n",$string);
//iterate through each line
for($k=0; $k 1){
$and[] = array();
$lastId = count($and)-1;
for($j=1; $j
Output:
Array
(
[0] => Array
(
[0] => user email ends with "@domain.com"
[1] => user name is "Bob" or user id is 5
[2] => Array
(
[0] => user id is 5
)
)
[1] => Array
(
[0] => user email ends with "@domain.com"
[1] => user name is "Bob" or user id is 5
[2] => Array
(
[0] => user id is 5
)
)
)