Follow

is one of those things for which I never really took the time to properly understand it. I've always found myself to resort to applying and tweaking existing examples. You know, the programming-as-stackoverflow-searches-approach.

Yesterday's 3 hour rabbit hole trying to get things working without having a good grasp reminded me once again of the folly of that approach. Any good sources you could recommend for learning about regular expressions?

Python-specific is a +

· · Web · 8 · 2 · 1

ha, so it seems the experimental method using a repl is the one which is most used. So what I was doing seems pretty sensible. However, thanks for the links to books etc. I think the experimental method will fare better with some more in-depth background knowledge!

@rra I'm sorry to say that, with regex, beyond a basic guide there's just no substitute for time in the repl fiddling with it.

@rra I usually use https://regexr.com which if you hover over each subsection explains what is happening with it.

@rra regexr.com is invaluable for me.

Flags etc requires a bit of further reading of the `re` module docs, but otherwise it's a godsend.

@rra not per se a learning page on regex, but I found (and still find - learning regex feels more like an open ended journey to me) regex101.com/ to be tremendously useful in the learning process, as the detailed and realtime visual feedback you get really allows you to get a more plastic feeling of how the very abstract instructions are applied by the regex engine

@rra
A quick howto
https://www.programiz.com/python-programming/regex

an extensive one (2 parts)
https://realpython.com/regex-python/

I visit both sites often for my python lessons and work.
HTH

@rra The thing that taught me regexps was learning and using vi as my main editor.

Sign in to participate in the conversation
post.lurk.org

Welcome to post.lurk.org, an instance for discussions around cultural freedom, experimental, new media art, net and computational culture, and things like that.