I am a beginner learning PHP. I am trying out various combinations with regex. I am referring to this and this and trying out examples on this.My doubts:[*]Why does \[code\]preg_match_all('((a|b)*c)', 'ababc', $arr, PREG_PATTERN_ORDER);\[/code\] give both ababac and a as output. Shouldn't it be just ababac?[*]Assuming that I'm trying to read all possible outputs in $arr, how do I do that without having to echo each element of the array? Currently I'm using \[code\]foreach\[/code\] , iterating through the available elements in $arr. Is this right/ is there a better way to do it?[*]Why does the \[code\]preg_match_all()\[/code\] give a 2D array with elements $arr[$i][0] and in some cases $arr[0][$i] where $i is no of of possible matches. Is there a way to know how the output will be stored? Sorry for posting too many questions in one post. Please tell me if I need to change it.Thanks a lot for your patience!