Regular Expressions in AutoHotkey are a great skill-set to have in your toolbox! In the below videos I start off reviewing what RegEx is and then break-out into various ways to perform pattern-matching . You also might want to check this thread on the AHK Forum
Also, be sure to check out Jack Dunning’s excellent book on Regular Expressions in AutoHotkey! I worked my way through it a few years back. It’s a great way to learn RegEx!
- RegEx 101- High-level overview
- RegEx 102- Classes
, ranges and grabbing the opposite using ^
- RegEx 103- Quantifiers (How many characters you wish to match)
- RegEx 104- Anchors: speed-up your scripts by matching the beginning or end of a line
- RegEx 105- Escapes: Simplify your Regular Expression in AutoHotkey by using shortcut symbols
- RegEx 106- Use Named subpatterns to simplify storing of variables
- RegEx 107- POSIX can allow laymen to have a chance understanding your RegEx
- RegEx 108- Store your match in an Object with the O) option in RegExMatch
- RegEx 109- 3 ways to Escape double-quotes in your RegEx
- RegEx 111- Use X) option Ignore whitespace within your RegEx & insert comments
- AHK Webinar focused on RegEx
- Great tips: RegEx on New Lines
- Lecture during AHK Con on RegEx / Stir split etc.
- Using a Look Ahead so the Pattern order does not matter
Examples of Regular Expressions in AutoHotkey
- Extract email addresses from text with RegEx
- Finding a URL and not an email address
- RegEx 110- Playing with a Naming Convention
- Clean-up HTML text with Regular Expressions in AutoHotkey
- Use RegEx in SciTE
- Microsoft Word has some decent functionality very similar to RegEx
- Parsing an Address with a Regular Expression
- Using StrSplit to parse on double quote (not a RegEX but very handy parsing text)
- Grabbing phone numbers with a RegEx in AutoHotkey
- Getting the unique YouTube ID from a long URL
- Adding attribute to an A tag (if it is missing) using a look-ahead