Regular Expressions for Network Automation

Brendan Choi · Apress eBooks · 2021

This chapter is dedicated to learning regular expressions basics. Python provides native ways to process and dissect strings of text but requires many lines of code to locate the exact string. Although Python provides powerful string indexing methods, in real life you will face challenges each time you need to handle a large string. I find it fascinating that no other Python network automation books genuinely emphasize the importance of data wrangling (or massaging) with regular expressions. Many books sweep regular expressions under the rug as it is not the most exciting topic to discuss. I realized that I must master regular expressions to get anywhere with any programming language. Still, I also did not dare tackle it seriously at first. Only when I started working on real projects did I realize my ignorance over regular expressions. I understand that this chapter’s content will be painful to digest for many readers, but you should stick with it and focus on completing this chapter; you will thank me later.

Read the paper · More papers on PaperTik