search

Using Regular Expressions to find a Ham Radio Vanity Call Sign

Today I'm going to tell you about regular expressions and how awesome they are.

Background

Regular Expressions are a way to define a pattern of letters/numbers to search for. Traditionally, regular expressions are marked with slashes on either side. Here are some simple examples:

  • /bar/
    Search for the word "bar"
    This will match: bar
  • /.*bar/
    Search for anything ending in "bar"
    This will match: candybar, foobar, rebar, openbar

There are lots of great guides online that will teach you how to use regular expressions, so I will not duplicate that effort here. In fact, there are entire books written about regular expressions. It's one of those programming tools that no serious geek should be without, like a swiss army knife.