how would I extend this preg_replace (in PHP), using regular expressions to replace white spaces also..
$this->permalink = preg_replace('[^a-z0-9]', '-', $this->permalink);
It's for generating page permalinks based on a page title. 'About me' will become 'about-me'. everything's fine except it doesn't remove the space yet.
Thanks!
[^a-z0-9]|\s, but your above expression works for me.