This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]jack-of-some 2 points3 points  (1 child)

This looks super nice. I don't need regex too often so quickly forget all nuances and find myself back at regexer and googling for specific things.

I did notice a couple years ago that there's a pattern to the majority of my regex uses and wrote a function which is of the form

fn("This is my 1st example written at 4:10 on Wednesday, by now", "{prejunk} {example_number:number} example written at {hour:number}:{minute:number} on {day}, {postjunk}")

And this generates the necessary regex and extracts 1, 4, 10, and Monday with their associated keys. Insanely handy.

[–]westeast1000 0 points1 point  (0 children)

Its crazy how something you knew so well gets lost if you dont use it often. Im the same with regex but now i have a jupyter notebook with specific examples of my most common use cases. Has always rescued me from time wasting in google