以下字符串的正则表达式是什么? [英] what is the regular expression for the following strings?
本文介绍了以下字符串的正则表达式是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
下面的正则表达式是什么:
> 10.8,
> = 10
< 2.0
< 7
< = 2.5
< = 5.0
1到2
1.2到2.5 >
3 - 5.5
6.5 - 8
在上面的示例中我们可以使用任意数字或任何双倍值。
what is the regular expression for below:
> 10.8,
>= 10
< 2.0
< 7
<= 2.5
<= 5.0
1 to 2
1.2 to 2.5
3 - 5.5
6.5 - 8
in the above examples we can use any number or any double value.
推荐答案
([><][=]?\s*\d+(\.?\d+)?)|(\d+(\.?\d+)?)\s*(-|to)\s*(\d+(\.?\d+)?)
我认为你的问题中的> 10.8中的逗号是一个错字,因为它没有任何意义。
I assume the comma in "> 10.8," in your question is a typo as it did not make any sense.
这篇关于以下字符串的正则表达式是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文