I believe you can use the following:
Assumptions: There won’t be any newline characters between the first t in tei and the last f in .pdf
How it works:
tei - This finds the 3 characters
tei that must be in a row without any other characters between them
.* - This uses the
. character which is a wildcard that matches everything except newline characters in conjunction with
* which matches the preceding character 0 or more times
\.pdf - This finds the 4 characters
.pdf that must be in a row without other characters between them. Since
. is a special character in regex, it must be escaped by preceding it with a backslash
Regex doesn’t use the asterisk
* as a wildcard for any character like you’re used to, an approximation of the * in VB.NET regex would be the period/full stop character
. which matches any character except newline.
I’d recommend checking out https://www.regular-expressions.info/ for a quick tutorial on how to use regex. I usually test everything out at http://regexstorm.net/tester (which is where I tested my answer to your question).
I used the following string to test if I could pull out your 3 examples and it did it without a problem.