This is a modification of the code I posted previously for regex practice. I change the from split() to splitlines(), splitlines() will split which row of the string only when the end of string is detected hence will preserve the string that has whitespaces in between on each row. So here's the example: notice the … Continue reading [python]Modification of the regex code
Tag: regex
[python]Match all once or none
. is a wildcard which occurs once. * is zero or more times, will also return more than one character between foo and bar. + is one or more times, will return also more than one character that is between foo and bar. the pattern "foo.bar" will present any single character between foo and bar. … Continue reading [python]Match all once or none
[python]Regular expression
I have been avoiding regex for years as I find it very intimidating, however it seems this is a necessary skill to learn to build real things, I have real use cases to match for routes, access-lists and interfaces of routers and firewalls. Here is a code snippet for the regex block, in this code … Continue reading [python]Regular expression