I have the following string:
keyword|title|http://example.com/
I would like to use the PHP function
preg_match_all ( $anchor, $key, $matches, PREG_SET_ORDER) )
currently
$anchor='/([\w\W]*?)\|([\w\W]*)/';
and I get $matches array:
Array
(
[0] => Array
(
[0] => keyword|title|http://example.com/
[1] => keyword
[2] => title|http://example.com/
)
)
I would like to get
matches[1]=keyword
matches[2]=title
matches[3]=http://example.com
How would I have to modify $anchor to achieve this?
\|([\w\W]*?)in your regex.