1
ink19 2022-06-10 15:14:25 +08:00
11.也可以认为是数字吧
|
3
longbow0 2022-06-10 15:19:08 +08:00
abc1.1.1abc 算不算?
|
4
just1 2022-06-10 15:27:31 +08:00
^(\d+(\.\d+)?|[a-zA-Z]+)+$
|
5
superychen 2022-06-10 15:37:46 +08:00
示例里带字母的情况下都加了双引号,双引号算不算在里面?
|
6
darklights 2022-06-10 15:48:58 +08:00
@just1 思路跟你差不多,但是无法排除 1.11.1x
|
7
superychen 2022-06-10 15:49:20 +08:00
试试这个
^\S[a-zA-Z]*(\d+(.\d+)?d?)?$ |
8
just1 2022-06-10 16:08:07 +08:00 1
@darklights ^((\d+(\.\d+)?(?!\d))|[a-zA-Z])+$
数字末尾加个否定就行了 |
9
gaozhy OP |