![](/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.