标签: regex preg-match
我真的很喜欢正则表达式,我正在试图弄清楚如何检查字符串是数字还是特定单词,例如 blah
//regex for number or a specific word "blah" 1 //ok 1a //not ok 5448 //ok blah // ok my horse is on fire // not ok lalala //not ok
答案 0 :(得分:1)
^(blah|\d+)$
regex101.com