Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Python

r"
(?m)(?P<head>^tacacs[\s|-]server\shost\s)(?P<ipv4>(\d+\.){3}\d+)(?P<key>\skey\s[0-9]\s\S[a-zA-Z0-9]+\S)?(?P<tail>(.*))
"
gm

Description

This query extract the entire tacacs legacy configuration by servers and divide its parts on groups

Submitted by anonymous - a year ago