> e.g. This pattern ([0-9][0-9]?[0-9]][.])+ matches one, two or three digits followed by a . and also matches repeated patterns of this. This wold match an IP address (albeit not strictly). I love regular expressions but one thing I've learned over the years is the syntax is dense enough that even people who are confident enough to start writing regex tutorials often can't write a regex that matches an IP address.
Writing one correctly is pretty complicated task if you’re trying to write a simple tutorial… off the top of my head, you’d need: ( ( 25[0-5] # 250-255 | 2[0-4][0-9] # 200-249 | 1[0-9]{2} # 100-199 | [1-9][0-9] # 10-99 | [0-9] ) \. ){3} ( 25[0-5] # 250-255 | 2[0-4][0-9] # 200-249 | 1[0-9]{2} # 100-199 | [1-9][0-9] # 10-99 | [0-9] ) … but without all the nice white space and comments, unless you’re willing to discuss…
You're right that Ruby has it. Perl also has /x, of course (since most of Ruby regex was "inspired" directly by Perl's syntax), as well as Python (re.VERBOSE). Otherwise, yeah, it's disappointingly rare.