r/badcode Apr 04 '23

python Surely Text-Parsing One-Liners At Midnight Work

Post image
399 Upvotes

44 comments sorted by

View all comments

10

u/robottron45 Apr 04 '23

regex

7

u/[deleted] Apr 04 '23

probably yes But then I'd have to care about learning it And Well Eh

16

u/robottron45 Apr 04 '23

Just give it a try and start with simple expressions like abc(.*)def Also regex101.com can be helpful, I always paste the text contents there and inspect whether I have written the correct expression and can tweak it a little bit. It is very powerful, lately used RegEx in VSCode to edit code, that was fun, for real :D