.replace(/regex/,’content’)

by Sue

Gaah. So I keep needing this because some bad CMS has outputted some crap css and I need to change it.

 
$('span.selector').each(function(){
$(this).html( $(this).html().replace(/\,/gi,'<br>') ); 
});

In this case I’m replacing commas with break tags.