1

I'm able to get the list of dependencies using jdeps: jdeps myjar.jar works fine.

Tried excluding a particular package in the output: jdeps -f 'java.io' myjar.jar - this excludes the package java.io from the output

Finally, i would like to exclude all packages that starts with the name "java" using regex:

  • jdeps -f 'java' myjar.jar -> didn't work (does not filter 'java' packages)
  • jdeps -f '/java/i' myjar.jar-> didn't work (does not filter 'java' packages)
  • jdeps -f '^java' myjar.jar -> didn't work (does not filter 'java' packages)

Can someone help me to filter all the packages that match a given pattern?

che_new
  • 45
  • 1
  • 6

1 Answers1

0

Try Negative Lookahead operator !?

The regex looks like this: ^(?!java) (returning only when line doesn't start with java)

The final code looks like this: jdeps -f '^(?!java)' myjar.jar

Valeriu Seremet
  • 558
  • 1
  • 7
  • 17