1

I'd like to exclude certain directories of code from getting analyzed for code coverage. I'm using the LCOV tool which has a --exclude parameter which I can include a regular expression to exclude files, packages, etc...

What would be the regular expression to exclude all directions except for Src/High/SS/FormCalc:

Src/High/SS/ATG_Help    
Src/High/SS/ConvCalc    
Src/High/SS/ConvX   
Src/High/SS/EFiling 
Src/High/SS/Edit    
Src/High/SS/FormCalc    
Src/High/SS/FormDisp    
Src/High/SS/Image   
Src/High/SS/Import  
Src/High/SS/Importables 
Src/High/SS/Intrview    
Src/High/SS/Intrview/Dialog 
Src/High/SS/Intrview/Dialog/Facades 
Src/High/SS/Intrview/Dialog/Facades/PrivateHeaders  
Src/High/SS/Intrview/Dialog/PrivateHeaders  
Src/High/SS/Misc

Src/High/SS/FormCalc is the only package I want to include.

What is the regex for this?

Moonie Asemani
  • 375
  • 1
  • 4
  • 13

1 Answers1

1

Exclude all paths that you presented except Src/High/SS/FormCalc:

Src\/High\/SS\/(?!FormCalc).+

See demo here: https://regex101.com/r/CYRDJp/1