php regex: escaped characters?
hiho@ll
i have a big problem with this:
$string = "test:test_test";
with a regex (and using e.g. preg_split) i want to split the above string into:
test
test
test
(how this stuff can be found within the array doesn't matter, the stringparts should be correctly)
the above example works with this:
$regex = "/[^A-Za-z0-9=]/";
e.g.
preg_split($regex,$string);
thats what i want and it works
explanation: split a string using a seperator which is NOT one of those characters: A-Za-z0-9=
but it's not complete:
i want this too
split a string using a seperator which is NOT one of those characters: A-Za-z0-9= AND a escaped non A-Za-z0-9 character!!!!
example: test:test\_test
result: test
test_test
if the result is test\_test it's not a problem
BUT i don't get it work
so any help would be great
thx@ll
Last edited by Thinking; 02-09-2006 at 05:56 AM.
|