Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有个问题。我有 1 个变量
set a "mau_gigabitethernet0/0/cpu0/2"
regexp在我需要获取的帮助下0/0/CPU0
regexp
0/0/CPU0
我收到一个错误,“<code>invalid escape \ sequence”谁能帮帮我..???
我会寻找这样的东西:
regexp {(?i)\d+/\d+/cpu\d+} $a extracted puts $extracted
请注意,正则表达式在大括号中,而不是双引号。这很重要。(如果它是在双引号中,那肯定"(?i)\\d+/\\d+/cpu\\d+"是很尴尬的。)另外,我用(?i)它来标记它为一个不区分大小写的正则表达式。
"(?i)\\d+/\\d+/cpu\\d+"
(?i)