Getting Data In
Highlighted

Help with regex whitelist

Champion

Hi,

I need to whitelist files that match this format in a directory. Hoping someone can help me....

WebAPIServRTPL1.20160102171339084.log
WebAPIServRTPL2.20160216225645002.log
WebAPIServMMKL1.20160102171339084.log
WebAPIServMMKL2.20160216225645022.log
WebAPIServOMAL1.20160102171339084.log
WebAPIServOMAL2.20160216225645022.log

0 Karma
Highlighted

Re: Help with regex whitelist

Communicator

If you're looking for just regex, depending on how specific you want it. Something like this might work:

WebAPIServ_[A-Z]{3}_L(1|2)\.\d{8}_\d{6}_\d{3}.log

View solution in original post

Highlighted

Re: Help with regex whitelist

Champion

Awesome. Great example as well.

Thanks!

0 Karma
Highlighted

Re: Help with regex whitelist

Communicator

Yup. Happy to help. If it works for you please accept as the answer. Thanks!

0 Karma
Highlighted

Re: Help with regex whitelist

Ultra Champion

Good places to play and define your regex:
http://www.regexr.com/
https://regex101.com/

0 Karma