• Become a Power user Intro to AutoHotkey Intermediate AutoHotkey Intermediate Objects GUIs are Easy w/AutoHotkey Painlessly switch from V1 to V2

RegEx 105- Simplify RegEx with escapes in AutoHotkey Regular Expressions

escapes in AutoHotkey Regular ExpressionsUsing RegEx to identify text patterns is an awesome skill-set to have.  In the below tutorial we review some of the shortcuts /escapes in AutoHotkey Regular Expressions.  These can make your code much more reader-friendly and easier to maintain.

Here’s a cheat-sheet for some of the more popular escapes:

  • \w =word character
  • \d = digit
  • \s =white space (tab, space, etc)
  • \b = word boundary

Remember, for each of the above, you can select the inverse of them simply by capitalizing the letter.

Demo video showing how to use Shortcuts / Escapes in AutoHotkey Regular Expressions

AutoHotkey Merchandise-White Stress ball

RegEx 104-Using Anchors in AutoHotkey Regular Expressions

Anchors in AutoHotkey Regular ExpressionsRegular Expressions are amazing but can also slow-down your AutoHotkey script.  Being able to us Anchors in AutoHotkey Regular Expressions are great ways to minimize false matches and speed-up your pattern matching!  The best part is they are very easy to use, just begin your search with a ^ to anchor your search at the beginning or use the $ to anchor it to the end of the line.   Also don’t forget to enable multi-line as 90% of the time you’re using Anchors you’ll be wanting to treat each line as a separate entity.

Video demonstrating using Anchors in AutoHotkey Regular Expressions

RegEx 103- Quantifiers in AutoHotkey Regular Expressions: . *+?{N}{N,M}

Quantifiers in AutoHotkey Regular ExpressionsAutoHotkey Merchandise-White Stress ballBeing able to specif icy how many times to look for a given pattern in your RegEx is invaluable!  In this video I demonstrate how the various Quantifiers in AutoHotkey Regular Expressions work.

When working with quantifiers, just remember they are looking for X number of  items that directly precede them.  For instance, when I use the below code, I’m looking for between 3 to 5 digits in my haystack:  (\d){3,5}.

Quantifiers in AutoHotkey Regular Expressions

RegEx 102-Using Classes & Ranges in AutoHotkey Regular Expressions: [a-z]

Ranges in AutoHotkey Regular Expression Regular Expressions are an amazing way to compliment your skill-set!  In this tutorial we’ll explore using classes & Ranges in AutoHotkey Regular Expressions.  In RegEx there are a ton of different ways to match your text pattern.  I’m starting off with one of the easiest to understand & follow.  Below are a few of the common usages of classes & ranges:

  • Basic usage: [12345], [abcde]
  • Ranges: [1-5], [a-e]
  • Complements “Not In”: [^6-9], [^f-z]

Ranges in AutoHotkey Regular Expression