Regular Expressions 101

Community Patterns

1...56789...877

Parse CISCO NEXUS 9xxx/5xxxx show inventory output w/o | json modifier

1

Regular Expression
Python

r"
(?:\s*?NAME\s*?:\s*?\"?)([0-9A-Za-z- ,]+)(?:\"?\s*?,\s*?)(?:DESCR\s*?:\s*\"?)([0-9A-Za-z- ,/+:]+)(?:\"?\s*?PID\s*?:\s*?)([0-9A-Z-]+)(?:\s*?,\s*?VID\s*?:\s*?)([0-9A-Z/]+)(?:\s*?,\s*?SN\s*?:\s*?)([0-9A-Z/]+)
"
gm

Description

Parse CISCO NEXUS 9xxx/5xxxx show inventory output w/o | json modifier. Nexus 9xxxx don't have the json output modifier. It's a LINUX based os, so | json would fork a json binary which doesn't exist

Submitted by skalef - 3 years ago (Last modified 3 years ago)