Home · About · Notes · Links · Login

Rubular Regular Expressions https://rubular.com/

CodeTool • 2023-05-22

I love using regular expressions1. These days, it feels like it's a thing that many new developers wouldn't touch with a 10-foot pole, unless they absolutely have to.

However, it's one of these "skills" that add so much to your coding repertoire. It makes complete sense to take your time to dive into the concepts, the same way it does for git. Instead, you usually hear "eww, regexes" or "git is too complicated". It really isn't.

For Ruby, I've been using Rubular2 to compose and test my regular expressions as long as I can remember. It even provides you with a neat regex reference.

Here's a regex I'm using in L1ngo, the text parser that is used on this website:

copy = '<a href="https://rubular.com/">Rubular</a>'
copy.scan(%r{<a[^>]* href="([^"]*)">(.*)<\/a>})
# => [["https://rubular.com/", "Rubular"]]

The below example fetches the domain name of links in the "Links" section of this website:

url.scan(URI::DEFAULT_PARSER.make_regexp).first[3].match(/(\w*.\.\w*)$/)[1]
https://rubular.com/ regular expressions editor

© 2025 by Indro De · Imprint

Limited Mobile Edition