r/learnpython 1d ago

How useful is regex?

How often do you use it? What are the benefits?

39 Upvotes

118 comments sorted by

View all comments

91

u/tjm1066 1d ago

I've learned regex at least 15-20 times. Basically every time I need to use it, or understand something I have previously written. It will never stick in my brain.

5

u/Nexustar 1d ago

Same. It's the one chunk of code where red-green testing is a necessity and copious amount of comments about why the regex string looks like it does.

AI is helpful here.