Applying regular expressions on network configuration to get specific information from the output requires us to write some complex expressions to solve some complex use cases. In some cases, you just need to retrieve some configuration or modify an existing one without going deeply into writing regular expressions, and that was the reason for the birth of the CiscoConfParse library (https://github.com/mpenning/ciscoconfparse).
Configuration auditing using CiscoConfParse
CiscoConfParse library
As the official GitHub page says, the library examines an iOS-style config and breaks it into a set of linked parent/child relationships. You can perform complex queries on these relationships: