I am trying to check if a string is in a string using RegEx in a AutoHotKey script.
If my string is a file path like this:
G:\htdocs\projects\webdevapp\app\folder\file.php
Then I need to extract the webdevapp part.
From the AutoHotKey docs it gives this example for a RegEx command that will store the found value to a variable:
; Returns 1 and stores "XYZ" in SubPat1.
FoundPos := RegExMatch("abcXYZ123", "abc(.*)123", SubPat)
So in theory something similar to this below except the regex part would need to be changed...
FoundPos := RegExMatch("G:\htdocs\projects\webdevapp\app\folder\file.php", "G:\htdocs\projects\(.*)\app\folder\file.php", DomainNameVar)
How can I extract that domain name from the file path into a variable in AutoHotKey?
It basically need to check if the string starts with G:\htdocs\projects\ and if it does then grab any character after that point until it comes up to the next \