I need to select a certain part of a string, that is between two substrings.
A bunch of different regex
combinations. I've been stuck on it for two days
\\srv00\DATA\Reports\2019-08-14 09_41_24<Text that can contain any character and needs to be found with regex>.txt
(the <>
are not actually part of the text)
(The text is not actually between brackets)
I'm using https://regex101.com/ to test my regex
.
Using the following:
(?:[\s\S]*[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}_[0-9]{2}_[0-9]{2} )(.*)(?=\.txt)
I was able to get it correct in group, but not in the full match, resulting in everything in front of .txt to be printed.
Note that the everything in front of the date and time can also be variable.
I want to select just the substring, But I'm getting the entire string in result.