【发布时间】:2019-02-02 15:04:29
【问题描述】:
使用正则表达式,我只想选择 单词 其中:
- 是字母数字的
- 不要只包含数字
- 不只包含字母
- 有唯一编号(1 个或多个)
我对正则表达式不是很擅长,但到目前为止,我已经尝试过[^\d\s]*(\d+)(?!.*\1),这让我无法接近所需的输出:(
这里是输入字符串:
I would like abc123 to match but not 123.
ab12s should also match
Only number-words like 1234 should not match
Words containing same numbers like ab22s should not match
234 should not match
hel1lo2haha3hoho4
hel1lo2haha3hoho3
预期匹配:
abc123
ab12s
hel1lo2haha3hoho4
【问题讨论】:
标签: javascript regex