基础知识介绍:
子表达式匹配
环视
引号内的字符串:"(^")*"
12小时制:(1[0123]|[1-9]):[0-5][0-9]*(am|pm)
24小时制:(([01]?[0-9])|(2[0-3])):[0-5][0-9]*
浮点数,保留小数点两位,如果第三位不为零,保留第三位:~s/(\.\d\d[1-9]?)\d*/$1/
纯数字,三位添加一个逗号:~s/(?<=\d)(?=(\d\d\d)+$)/,/g
文本中插入的数字,,三位添加一个逗号:~s/(?<=\d)(?=(\d\d\d)+(?!\d))/,/g 或 ~s/(\d)(?=(\d\d\d)+(?!\d))/$1,/g 或
~s/(\d)((\d\d\d)+(\b))/$1,$2/g (此正则需在while循环内)