cod*_*ict 14
你可以使用正则表达式:
^[\d() -]+\+$
Run Code Online (Sandbox Code Playgroud)
说明:
^ : Start anchor
[ : Start of char class.
\d : Any digit
( : A literal (. No need to escape it as it is non-special inside char class.
) : A literal )
: A space
- : A hyphen. To list a literal hyphen in char class place it at the beginning
or at the end without escaping it or escape it and place it anywhere.
] : End of char class
+ : One or more of the char listed in the char class.
\+ : A literal +. Since a + is metacharacter we need to escape it.
$ : End anchor
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4525 次 |
| 最近记录: |