Hello - In the related question, the pattern is working perfectly, but I've discovered that the file path doesn't always begin with file://. So I have been reading up on the regex patterns and the behavior of the metacharacters, but I am having a hard time figuring this out.
I think if someone could please provide the correct pattern I need, then looking at the previous pattern and this new pattern will be helpful in understanding how everything works.
The complete file path is going to be similar to one of the following...
I wanted to try to match "Jacksonville" because that will always be in the file path.
Set Regex = CreateObject("vbscript.regexp")
Regex.Pattern = "(//|\\\\)[^\[Jacksonville].]+\.pdf"
Regex.Global = True
regitm = Regex.test(objMess.body)
If regitm Then
Set regm = Regex.Execute(objMess.body)
Forms("frmPricingLoadExternal")!txtFileLoc = Right$(regm(0), Len(regm(0)) - InStr(regm(0), "//") - 1)
MsgBox "Message not found", vbSystemModal