第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

數(shù)字,字母和:的正則表達(dá)式

數(shù)字,字母和:的正則表達(dá)式

PHP
寶慕林4294392 2021-05-13 14:10:21
我正在嘗試為特定字符串編寫一個(gè)正則表達(dá)式:要匹配的每個(gè)字符串應(yīng)從數(shù)字[1-9]開始,并且可能包含或可能不包含前綴。例如:0  - not match1  - match9  - match 2: - not match3:ABC - match4:56ARD20 - match5:56ARD20(any other chars except [0-9A-Z]) - not matchA:5GTS - not match (just a digits in the first part)A1:GRT - not match (just a digits in the first part):FDE3  - not match (first part should contain only digits):      - not match (empty first digital part)因此,字符串的第一部分->僅是數(shù)字(強(qiáng)制性)。字符串可以包含一個(gè)帶后綴[0-9A-Z]的符號(hào)(:)。
查看完整描述

2 回答

?
一只斗牛犬

TA貢獻(xiàn)1784條經(jīng)驗(yàn) 獲得超2個(gè)贊

正則表達(dá)式 ^[1-9]\d*(?::[A-Z\d]+)?$


可讀的


 ^                    # BOS

 [1-9] \d*            # Digit(s) required (can only start with 1-9

 (?:                  # Optional group

      :                    # Colon

      [A-Z\d]+             # Upper case letters or digits

 )?

 $                    # EOS


查看完整回答
反對(duì) 回復(fù) 2021-05-28
  • 2 回答
  • 0 關(guān)注
  • 122 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)