I am trying to parse the date out of this file name with regex.
LBX845656_PayOnline_0528-20191429.txt.052819220054.bak
The problem I am encountering is that I need the regex to match the entire filename, while capturing a group with the Date in it.
I have written this regex to capture the Date in capture group 1:
([0-9]{0,8}(?=\.txt))
Using a regex tester online, this seems to capture the correct string from the filename I am looking for, but I cant figure out how to also get the regex to match the whole string.
Here is what I want to return
FULL MATCH: LBX845656_PayOnline_0528-**20191429**.txt.052819220054.bak
CAPTURE GROUP 1: 20191429
Thanks in advance for any advice.