在properties文件中这样写:
msg.flag=temp1 = temp1.replace(/(\d{3})/g,"$1,");
通过getProperty("msg.flag")得到的结果却是:
temp1 = temp1.replace(/(d{3})/g,"$1,");
这个样子
\ 这个反斜杠没有了
为什么啊?怎么可以解决这个问题哈?
谢谢大家了。
msg.flag=temp1 = temp1.replace(/(\d{3})/g,"$1,");
通过getProperty("msg.flag")得到的结果却是:
temp1 = temp1.replace(/(d{3})/g,"$1,");
这个样子
\ 这个反斜杠没有了
为什么啊?怎么可以解决这个问题哈?
谢谢大家了。
msg.flag=temp1 = temp1.replace(/(\\d{3})/g,"$1,");
多加一个反斜杠
msg.flag=temp1 = temp1.replace(/(\\d{3})/g,"$1,");
这样写就可以了
呵呵
想复杂了
各位见笑了哈