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

RegEx 101-Intro to Regular Expressions in AutoHotkey- Pattern matching made easy!

Regular Expressions in AutoHotkey

Regular Expressions in AutoHotkey (RegEx) are an amazing tool to have in your toolbox!  The simplest definition I have found of Reg Ex are: “Symbols that describe a Text Pattern”.  It is more than likely that you’ve used them in the past.  Here are a few examples where you have probably used them:

  • Using * or ? when looking for a file in Windows Explorer
  • Validate format ( email, phone number, zip code, two-letter state abbreviation)
  • Search & replace text in files
  • Count # of times pattern exists
  • Find duplicate words

In this intro video I give a high-level overview using Regular Expressions in AutoHotkey.  The video demonstrates pattern matching by using Expressive by Alguimist.  There are several other tools specifically written in / for AutoHotkey however this one is pretty simple and does 99% of what you’ll need.  You also might use RegEx101 for aiding your pattern matching.

RegEx 101- Regular Expressions in AutoHotkey

Using 6 built-in SciTE Find and Replace features- Great time savers!

It always amazes me of how frequently I have to manipulate text I in various ways.  More often than not it is simply doing a SciTE find and replace but being able to have other ways to manipulate text is also a great time saver!

In this video I walk through some of the tips & tricks of using SciTE search and replace text within the text editor.  I also demonstrate one of the “coolest” features which is block / typing across multiple lines.  This is a GREAT feature which many do not know how to use.  The Regular Expressions and dealing with line returns / new lines are also very helpful.

 

SciTE find and replace

In the video I also showed how I updated my AutoHotKey SciteUser.properties file.  Below is the line I added
#### Changing SciTE Find and Replace to posix regular expression mode so do not have to escape parens
find.replace.regexp.posix=1

And here are a couple of helpful pages with SciTE  documentation, SciTE RegEx documentation

Demonstration of SciTE Find and Replace Features

To avoid having to escape parens (watch above video) add the following in your SciTE user.properties file.   If set to 0, syntax uses the old Unix style where \( and \) mark capturing sections while ( and ) are themselves.  If set to 1, syntax uses the more common style where ( and ) mark capturing sections while \( and \) are plain parentheses.

find.replace.regexp.posix=1

Here are some useful POSIX terms which are more readable in your SciTE Find and Replace

[:xxx:] were xxx is one of the following words:
NAME DESCRIPTION
alnum    letters and digits
alpha    letters
word “word” characters (like \w)
digit    decimal digits (like \d)
space    white space
punct    printing characters, excluding letters and digits
lower    lower case letters
upper    upper case letters