How to prevent a regex filter from catching a valid file name

How to prevent regex to catch this file name:

"Metview Turbine Tool Record_08.01.2018_monitor.pdf"

This is the regex filter that is catching that file:

GSIS\\.dat|RCM_V_.*\\..*|GMWOD-.*|RMQS.*\\..*|O.*\\.[0-9]{3}|.*\\.SPS|PLAN.*\\.XML|.*LICENSE\\.MLF|ITSYSE.*\\..*|ITSYSW.*\\..*|MSPSALV.*\\..*|MSPSV.*\\.DAT|VESI.*|VESU.*|WCR.*\\.DAT|TRF_SPLIT.*

Open in new window


It seems the dots in the PDFs date is triggering the regex filter. Removing the dots in the date "Metview Turbine Tool Record_08012018_monitor.pdf"
MontyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David Johnson, CD, MVPOwnerCommented:
you have to define an invalid filename and work with that as a base
0
Rgonzo1971Commented:
Hi,

pls try
\\b(GSIS\\.dat|RCM_V_.*\\..*|GMWOD-.*|RMQS.*\\..*|O.*\\.[0-9]{3}|.*\\.SPS|PLAN.*\\.XML|.*LICENSE\\.MLF|ITSYSE.*\\..*|ITSYSW.*\\..*|MSPSALV.*\\..*|MSPSV.*\\.DAT|VESI.*|VESU.*|WCR.*\\.DAT|TRF_SPLIT.*)\\b

Open in new window

REgards
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MontyAuthor Commented:
Hi Rgonzo1971, can you please explain the logic?
0
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

ozoCommented:
O.*\\.[0-9]{3}  can match "ol Record_08.01.201", assuming case insensitive matching is used
\\bO will prevent a match between "oo" or between "To" or between "co"
[0-9]{3}\b will prevent a match between "18"
0
MontyAuthor Commented:
Thank you but Rgonzo1971 placed the \b flag only at the beginning of the regex expression.

\\b(GSIS\\.dat...
0
ozoCommented:
The rest of the regular expression is grouped in ( )

So the \b could also potentially prevent other matches if you wanted any of the other alternatives to match in the middle of words.
0
MontyAuthor Commented:
Hi Ozo and all

I used https://www.regextester.com/ to test and it does not match it.
0
MontyAuthor Commented:
Hi David, could you please explain... this >> "you have to define an invalid filename and work with that as a base"
0
Rgonzo1971Commented:
You say it does not match but your question is how to to prevent a match?
0
MontyAuthor Commented:
Thank you!
0
MontyAuthor Commented:
Hello! I meant to give credit to @OZO as well. How can I do this the question is closed.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Regular Expressions

From novice to tech pro — start learning today.