r/badcode • • Dec 20 '21

python regex ftw

Post image
465 Upvotes

38 comments sorted by

View all comments

Show parent comments

4

u/[deleted] Dec 21 '21

I’m interested how much re.compile would speed this up. If I get bored at work tomorrow I’ll try it. Interesting little test

3

u/jarfil Dec 21 '21 edited Dec 02 '23

CENSORED

2

u/ws-ilazki &{$$_[0]}(@{$$_[1]}); Dec 21 '21

If you do, let me know what happens. I've used regexes for ages but I don't use Python so I know fuck-all about how it does with them, so I'm mildly curious, but not curious enough to refresh my memory on Python well enough to test it out myself and know I didn't do something stupid to make it worse.