Getting Data In

Help with regex whitelist

a212830
Champion

Hi,

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

WebAPIServ_RTP_L1.20160102_171339_084.log
WebAPIServ_RTP_L2.20160216_225645_002.log
WebAPIServ_MMK_L1.20160102_171339_084.log
WebAPIServ_MMK_L2.20160216_225645_022.log
WebAPIServ_OMA_L1.20160102_171339_084.log
WebAPIServ_OMA_L2.20160216_225645_022.log

0 Karma
1 Solution

ejharts2015
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

ejharts2015
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

sloshburch
Ultra Champion

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

0 Karma

a212830
Champion

Awesome. Great example as well.

Thanks!

0 Karma

ejharts2015
Communicator

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

0 Karma
.conf21 Now Fully Virtual!
Register for FREE Today!

We've made .conf21 totally virtual and totally FREE! Our completely online experience will run from 10/19 through 10/20 with some additional events, too!