0

I have a folder structure like this:

main
|__Test
   |__Sub
      |__Match
      |__Match1
      |__Match2

I have a requirement to:

  1. Match only one folder - "Match"
  2. Match multiple folder - "Match, Match1, Match2

For a) I've tried:

/main\/Test\/Sub\/Match\//

But that didn't help.

Basically, I am using Isparta, and I need to exclude a few folders from instrumentation.

Grant Miller
  • 27,532
  • 16
  • 147
  • 165
nishantcop
  • 977
  • 1
  • 8
  • 24

2 Answers2

0

Try this one:

\/main\/Test\/Sub\/Match([0-9])?\/?
Inquisitive
  • 386
  • 2
  • 5
0
/^main\/Test\/Sub\/Match[0-9]?\/?$/

I used [0-9] because you mentioned a structure Like. Assume there are not only match1 and match2.

Sagar V
  • 12,158
  • 7
  • 41
  • 68
  • Yes. This understanding is correct but this regex didn't help – nishantcop Jun 09 '17 at 13:18
  • Please define _didn't help_ – Sagar V Jun 09 '17 at 13:23
  • I meant it didn't really work for my scenario. I was expecting it to match folder pattern. But it didn't work for excluding folders with Isparta to exclude certain folders from instrumentations. May be something wrong at my end. – nishantcop Jun 09 '17 at 13:27