[英]Regex: match and replace on a date
I'd like to convert the date separators in a date. 我想在日期中转换日期分隔符。
So, from 11.11.2009 -> 11-11-2009 所以,从2009年11月11日 - > 11-11-2009
Could someone help me do that with a regex? 有人帮我用正则表达式做到这一点吗?
my_date = my_date.replace(/\./g, '-');
你的意思是'11.11.2009'.replace(/\\./g, '-')
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.