• Intro to AutoHotkey HotStrings with AutoHotkey Intermediate AutoHotkey GUIs are Easy with AutoHotkey Intro to DOS & AutoHotkey AutoHotkey FAQ AutoHotkey FAQ

AutoHotkey webinar on Regular Expressions- Learn some great RegEx Tips!

AutoHotkey Merchandise-White Stress ballThis AHK Webinar focused on Regular Expressions.

AutoHotkey Webinar Videos

AutoHotkey webinar

Video of Hour One

Video of Hour two

Content from AutoHotkey Webinar

What are Regular Expressions?

  • “Symbols that describe a text pattern”
  • Pattern matching- Chances are extremely high that you’re familiar with this.
    • 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

When to use RegEx vs. other functions like StrReplace(), InStr()

  • When Haystack is smaller- probably doesn’t matter
  • StrReplace() and InStr() are faster than RegEx but simpler

General rule-of-thumb:  Use RegEx when your pattern is more complex

RegExMatch vs. RegEx Replace

There is definitely overlap between the two tools however here is a high-level view of their “niche” areas & important their differences:

RegExMatch()

  • Tool for finding, saving & extracting specific matches
  • Once your match is found, RegExMatch has done it’s job and stops processing. To continue you need to restart beginning where your last match was found
  • Does NOT affect original data
  • Returns found position
  • O) Match pattern can be returned as an object/pseudo array for easy access

RegExReplace()

  • Modification tool allows you to change (re-order/structure, swap out) your data
  • Does not stop after finding first match. Unless otherwise stipulated it proceeds through the entire haystack
  • Returns Newstring:= (altered) string

AutoHotkey Bottle 3Common / Helpful RegEx Options

  • m) Multiline (treats each line as separate text)
  • U) Ungreedy (stops at first match)
  • x) Ignore whitespace (great for multiline RegEx)
  • C) Auto-callout mode (help show where you are in your Expression)
  • O) (in RegExMatch) returns match in object

Quantifiers

  • * 0 or more times
  • ? 0 or 1 times
  • + 1 or more times
  • {N} exactly N times
  • {N,} N or more times
  • {N,M} N through M times

Characters Needing Escape

  • \ . * ? + [ { | ( ) ^ $”

Ranges

  • [1-5], [a-e]

Special Characters

  • ^ Start of Line
  • $ End of Line
  • . Any character

Escapes

  • \d  Digit              \D   Non-digit
  • \s Whitespace    \S    Non-whitespace
  • \w “Word“          \W Non-“Word”
  • \n  New Line       \t  Tab
  • \r  Line Return   \b  Boundary
  • \QLiteral\E
  • \x  where x is Hex  \x22=“

Regular Expression Resources

AutoHotkey Help

Tools Built in AutoHotkey

Websites to test dynamic code

Additional Resources

Check out more AutoHotkey webinars

Sign-up for future ones hereWhite sticker on computer 4

AutoHotkey Webinar: 10/18/2016 Excel and COM with AutoHotkey

AutoHotkey webinar Excel and COMExcel and COM with AutoHotkey

 

AutoHotkey Webinar Videos & LinksExcel and COM

  • Here is a link to video of the First hour (Thank you Joe W for providing this.  I forgot to record the first hour!)
  • Video of Second hour where we chit-chat about how to best solve some problems.

Link to AutoHotkey Webinar resources Excel and COM:

 Resources covered during Excel and COM AutoHotkey webinar

 Excel and COMFeatured Script- Toggle to other monitor

AutoHotkey webinars are planned for the third Tuesday of each month.  Signup to future webinars here

AutoHotkey Webinar: 9/20/2016 Using Functions and DLL call in AutoHotkey

AutoHotkey webinarAutoHotkey Webinar Videos and LinksBlack Bottle2

Link to AutoHotkey Webinar resources:

Additional resources mentioned in AutoHotkey Webinar

Using built-in Functions

SubStr(String, StartingPos [, Length])

Trim()

Round(Number[,N])

AutoHotkey Bottle 4Creating your own custom function

  • Why you want to create them
  • Things to pay attention to:
    • Accessing variables outside your function
    • Passing parameters
    • Setting defaults
    • Returning values

DLL call

  • What is it?
  • Why is it so valuable an Asset?
  • Why is it so ‘tricky’?
  • Message Box
 
v:= DllCall("MessageBox","Uint",0,"Str","my message","Str","my title","Uint","0x00000036L")

 

Additional DLLCall Resources

Script Highlight- Pasting plain text

#SingleInstance Force
^g:: ;Control G pastes plain text
Store:=ClipboardAll ;Store full version of clipboard
ClipBoard := ClipBoard ; Convert to plain text
Sleep, 50
SendInput, ^v ;paste plain text
Sleep, 50
Clipboard:=Store ;restore clipboard to original content
return

AutoHotkey Bottle 1

Register for upcoming AutoHotkey webinars here

 

AutoHotkey Webinar: 8/30/2016

AutoHotkey webinarAutoHotkey Webinar Videos and LinksAutoHotkey Bottle 1

Link to AutoHotkey Webinar resources:

Squishy Ball 2Additional resources mentioned in AutoHotkey Webinar

Here is a link where you can register for upcoming AutoHotkey webinars