Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Type of Regex in Eclipse MAT

What type of Regex syntax does MAT support? I assumed it would be Java's (though Java's Regex isnt Regular per se) but it didn't seem to work.. I tried Perl's and it didn't work. I need Regex's to filter out the list in MAT's Histogram. eg: Include arrays but exclude char arrays. Exclude java.lang.String Include java.util.Collections.*

For arrays just typing in "[]" (without quotes) works and I could manually type each one in but I'd like to do it in one go to automate the process.

like image 668
vmhacker Avatar asked Nov 04 '22 18:11

vmhacker


1 Answers

Here's the Regex that you can use to include and exclude multiple Strings in the Eclipse MAT histogram filter.

Regex filter to include Strings

.*STRING1.*|.*STRING2.*|.*STRING3.*

Example include "java.util", "java.lang", "char[]"

.*java.util.*|.*java.lang.*|.*char\[\].*

Regex filter to exclude Strings

^(?!.*STRING1|.*STRING2|.*STRING3).*$

Example exclude "java.util", "java.lang", "char[]"

^(?!.*java.util|.*java.lang|.*char\[\]).*$

like image 80
Peter Tarlos Avatar answered Nov 10 '22 06:11

Peter Tarlos