Hi, I just finished reading the tutorial on regex (http://www.phpbuilder.com/columns/dario19990616.php3?page=4). I don't understand Dario's last example:
For instance, say we want do get the filename from a path/URL string -- this code would be all we need:
ereg("([\/]*)$", $pathOrUrl, $regs);
echo $regs[1];
I am not sure why he has listed it with two backslashes in it ("[\/]"). I thought the backslash didn't need escaping when it's within brackets. Or is he escaping the forward slash? I thought the forward slash doesn't need escaping.
Anyone expalain this one?
Thanks,
Misha