我没有写下面的正则表达式,我试图找出它的作用.我知道它必须从策略映射开始,并且必须在策略映射和下一步之间至少有一个空格.但我一直试图找出括号内的东西意味着什么.我知道无论它是什么,它都必须在最后.
^policy-map\\s+([\\x21-\\x7e]{1,40})$
Run Code Online (Sandbox Code Playgroud)
谢谢!
^ 字符串的开头
policy-map 不变
\s+ 空间
([\x21-\x7e]{1,40}) 从\ x21到\ x7e的1-40个符号(即所有可打印的非空白ASCII字符,包括标点符号,大写和小写字母和数字)
$ 字符串的结尾
^ Start of string
policy-map "policy-map"
\\s+ One or more whitespace characters
( Start of capture group 1
[\\x21-\\x7e] From 1 to 40 characters in the range '\x21' to '\7E'
) End of capture group 1
$ End of string
Run Code Online (Sandbox Code Playgroud)