A Beginner Starts to Climb "Mount RegEx"

I agree with @Tom. This would also be my suggestion.
I would start with Regular Expressions Quick Start

Actually, that's a great question, but a bit vague. :smile:
There is a general answer, and then specific answers.

General Answer, OR, What is the purpose of RegEx?

Before I go any further, let me say that I still consider myself a novice at RegEx. So, what I say below is subject to review and correction by other KM Forum members who are far more experienced than I.

At a high level I would say this:

  • A regular expression (sometimes abbreviated to "regex") is a way for a computer user or programmer to express how a computer program should look for a specified pattern in text. This is called "matching".
  • RegEx is a search pattern for finding, or "matching", one or more substrings in a string of text.
  • RegEx is a search pattern for matching "Capture Groups", which are sub-strings within the overall matched sub-string.

The matched substring, and the Capture Group(s), are returned to the user's program to use in some way. There can be many ways of course, but in general I'd say it breaks down into at least these classes (and maybe more):

  1. Parse (extract) the matched text for use elsewhere
  2. Replace the matched text with some other string.
  3. Validation of string for a particular purpose (like a date, or URL)

Here is a simple example of #1:
Using RegEx to Parse the KM Engine Error Log

Generally the tool you use, like Keyboard Maestro, JavaScript, BBEdit, TextWrangler, etc, will provide specific methods for obtaining a match, and then doing something with that match.

See Regular Expressions [Keyboard Maestro Wiki]

1 Like