I am trying to parse my URL into different parts using this RegExp:
([\w\\.-]*)
Given an example URL http://www.foo.com/bar/baz I get those results from preg_match_all():
Array
(
[0] => Array
(
[0] => http
[1] =>
[2] =>
[3] =>
[4] => www.foo.com
[5] =>
[6] => bar
[7] =>
[8] => baz
[9] =>
)
)
It seems that it parses any invalid character into an empty item.
How do I solve this?