I’m having trouble with what seems like a simple regex capture. I’m using AutoIt’s stringRegExp() function.
The source string is:
1 U:\some text here\more text over here\06-17-2011\Folder 2\161804\abc9831\xyz10007569.JPG
I’m trying to capture “abc9831” and “161804”. The “abc” part can be “abc”, “def”, or “ghi”, followed by a string of digits. The “161804” can be replaced with any string of text. Everything is case insensitive. I’m currently using the following regex pattern:
(?i)\\\\.+\\\\((abc\d+)|(def\d+)|(ghi\d+))
But it’s only capturing the “abc9831” part. How do I pick up the text string preceding it?
When the regex below is used in AutoIt’s
StringRegExp()function (using the flag “1” to return an array of matches), it returns161804\abc9831. Is this what you’re wanting to return?Here’s an example you can run yourself: