我怎样才能获得只允许0000或空格的正则表达式,但不能同时使用两者
例子:
^(?:0+| +)$
Run Code Online (Sandbox Code Playgroud)
说明:
^ # Start of string
(?: # Either match (but don't capture)...
0+ # one or more zeroes
| # or
[ ]+ # one or more spaces
) # End of non-capturing group (used to contain the alternation)
$ # End of string
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
110 次 |
| 最近记录: |