views:

56

answers:

3

I'd like to convert the date separators in a date.

So, from 11.11.2009 -> 11-11-2009

Could someone help me do that with a regex?

A: 

In Perl:

s/\./\-/g

Sfger
+4  A: 
my_date = my_date.replace(/\./g, '-');
BipedalShark
Excellent, thanks. I bet that one was really easy for you!
Ben
+2  A: 
you mean '11.11.2009'.replace(/\./g, '-')
Murali VP