Google 以逗号作为小数点分隔符的数字形式正则表达式
Google form regex for numbers with comma as decimal separator
我正在尝试找出一个正则表达式用于 Google 以逗号作为小数点分隔符的数字的表单数据验证。
有效条目示例:
123,5 ; 1 ; 0,1 ; 0,001
无效条目示例:
123.5 ; [a-z] ; any characters other than numbers
我已经尝试过 ^[1-9]\d*(,\d+)?$
但它似乎不接受逗号。
示例:
123,5 ; 1 ; 0,1; 0,001
正则表达式
[\d*.\,{1}\;{1}]
以下将匹配整数和小数
(?:\d*\,)?\d+
我想你用逗号表示小数。
我正在尝试找出一个正则表达式用于 Google 以逗号作为小数点分隔符的数字的表单数据验证。
有效条目示例:
123,5 ; 1 ; 0,1 ; 0,001
无效条目示例:
123.5 ; [a-z] ; any characters other than numbers
我已经尝试过 ^[1-9]\d*(,\d+)?$
但它似乎不接受逗号。
示例:
123,5 ; 1 ; 0,1; 0,001
正则表达式
[\d*.\,{1}\;{1}]
以下将匹配整数和小数
(?:\d*\,)?\d+
我想你用逗号表示小数。