Ok, this simply sucks.
I want to parse a string like:
code:
$psm = "\\0Music\\01\\0Nu op Q: {0} - {1}\\0When It All Falls Apart\\0Veronicas\\0\\0\\0";
to an array containing its elements, like:
code:
$match = array(4) {
[0]=> string(5)
"Music"
[1]=> string(18)
"Nu op Q: {0} - {1}"
[2]=> string(23)
"When It All Falls Apart"
[3]=> string(9)
"Veronicas"
}
using preg_match(). But now I have problems with the backslash... uh?!
This code fails:
code:
preg_match("/^\\0([a-zA-Z]+)\\01\\0(.*?)\\0(.*?)\\0(.*?)\\0(.*?)\\0(.*?)\\0(.*?)$/", $psm, $ico_match);
And while I tried to look for the fault, I found that this:
code:
preg_match("/0([a-zA-Z]+)/", $psm, $ico_match);
finds "Music", while this one:
code:
preg_match("/\\0([a-zA-Z]+)/", $psm, $ico_match);
fails.
Any ideas?