Hacker News new | ask | show | jobs
by thrwway3473 2515 days ago
Nice resource. You do start off making it a bit daunting:

>For most people without a formal CS education, regular expressions (regex) can come off as something that only the most hardcore unix programmers would dare to touch.

my experience wasn't as daunting as this at all.

this is my story: basically every regex I ever wrote always worked the first time and I found it super easy. my intro was the Perl 5 "camel" book, i.e. Programming Perl. never heard of regexes before that.

If you find this current tutorial we're discussing tricky or daunting, maybe give the resource I just mentioned ("Programming Perl" for Perl 5) a go because for whatever reason the explanation was super simple and writing a regex was one of the easiest things I ever did no matter what I wanted to do. I didn't know about the concept itself before I read that book. I've used it to parse loads and loads of things, use it in my editors, etc. It's always so easy.

I don't know if you can find the "Programming Perl" book, I tried to look and found something like that here: https://www.cs.ait.ac.th/~on/O/oreilly/perl/prog/ch01_07.htm

you can maybe ignore the stuff about Perl and still sort of follow the tutorial.

just an alternative in case someone had their curiosity piqued by this illustrated guide, but it doesn't quite "click" for them,, and wanted to see the same thing written out in another teaching way. And a note that for me it was always not daunting at all!

2 comments

I also learned regex from that book and had the same experience as you, so although I can't remember how that book worked it's magic (it's been nearly 20 years) I can corroborate your recommendation.

I also found the various perldoc pages on regex to be very helpful resource that I referred to frequently back when I was writing perl. Notable pages are perlretut [0], which serves as an intro to regex, perlre [1] which goes into considerable depth, and perlreref [2] which is a handy quick reference for day-to-day work.

[0] https://perldoc.perl.org/5.30.0/perlretut.html

[1] https://perldoc.perl.org/5.30.0/perlre.html

[2] https://perldoc.perl.org/5.30.0/perlreref.html

By any chance studied in Belgium, Ghent? Just curious for educational purpose :)
>By any chance studied in Belgium, Ghent?

No, I didn't. (at the time, bought the Perl book in the U.S., where I read it.)