![](/img/trans.png)
[英]Regular expression for a string that must contain minimum 14 characters, where at minimum 2 are numbers, and at minimum 6 are letters
[英]regular expression where the value must contain Letters, blank space and numbers
如何获取正则表达式来定义值是否包含字母,空格和数字。
注意:该值必须包含字母,数字和空格。
例如。
Maalderijstraat 45 Valid
Tronestraat Not Valid
Tronesttart45 Not Valid
123456 Not Valid
我正在使用此查询:
select a.street
from clients a
where REGEXP_LIKE (a.street,'^[a-zA-Z0-9]*$')
您使用的正则表达式不包含任何空格,并且如果将它们全部放在同一个“类”( []
之间的东西)中,则只能匹配其中一个,因此,如果每个字符都与az
匹配,那么即使存在里面没有数字。
我再次怀疑您是否需要正则表达式:
select a.street
from clients a
where a.street like '[A-Za-z]% %[0-9]'
但是我想你可以:
select a.street
from clients a
where REGEXP_LIKE (a.street,'^[a-zA-Z ]+ [0-9]+$')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.