Hi,
I'm trying to retrieve the suffix from a windowstitle with RegExMatch.
For example the title is: "Lucie Diamond.doc .tif [Schreibgeschützt] - Microsoft Office Document Imaging"
Can I search the title from behind, when I set StartingPostition = 0 to obtain ".tif" and not ".doc"?
The ahk help says:
Quote:
If StartingPosition is less than 1, it is considered to be an offset from the end of Haystack. For example, 0 starts at the last character and -1 starts at the next-to-last character.
Code:
;the search from the beginning works, but delivers ".doc "!! :(
FoundPos := RegExMatch("Lucie Diamond.doc .tif [Schreibgeschützt] - Microsoft Office Document Imaging", "\.([a-zA-Z]{3} )", SubPat)
msgbox, SubPat1:|%SubPat1%|`nSubPat2:|%SubPat2%|`nFoundPos:|%FoundPos%|
Code:
;But to start searching from the end to get ".tif " doesn't work!?
FoundPos := RegExMatch("Lucie Diamond.doc .tif [Schreibgeschützt] - Microsoft Office Document Imaging", "\.([a-zA-Z]{3} )", SubPat,0)
msgbox, SubPat1:|%SubPat1%|`nSubPat2:|%SubPat2%|`nFoundPos:|%FoundPos%|
Thanks in advance for any suggestions
