I want to format this date: 23/05/2013.
23/05/2013
First I want to split the string at the first / and have the res
/
Try this
$("div#date").text().trim().replace(/\W/g,'/');
DEMO
Look a regular expression http://regexone.com/lesson/misc_meta_characters
enjoy us ;-)