常用正则表达式

x.xx 保留两位小数

/^[1-9]\d*\.?\d{0,2}$|^0\.[1-9]{1}\d?$|^0\.\d[1-9]$/;

 

替换字符串中 以{开始 }结束的字符串 .*代表任意字符
preg_replace('/\{.*\}/','',$str);

posted on 2013-09-03 17:39  ijoanne  阅读(100)  评论(0)    收藏  举报