To replace a string or substring in Python you have two main options: Python’s String Replace Method The string.replace method works roughly how you would expect it to: By default, string.replace will replace all occurrences of the string you want to replace. However, it accepts an optional integer third argument specifying how many times to […]
Regex
Regex Cheatsheet
Regex is very powerful and available in virtually every language. Eventually I’ll write a whole post about why every engineer should know some Regex, but this post is all about common regex patterns, flags, etc—in easy-to-read table form. First, here are some patterns similar to ones I’ve used in recent memory: Pattern Meaning Example Match […]