You know, this really drove me crazy today, because it is something that should be very simple to do.
I have two .classpath files, and I want to compare all of the jar files that they use. Since the path information may be different, I wanted to just get the list of everything '.jar'.
So a line like, '<classpathentry kind="lib" path="C:/apache-tomcat-8.0.99/lib/servlet-api.jar"/>', would just produce 'servlet-api.jar'
So I tried with grep and then sed and then
java regex (
Pattern and Matches) and finally String.split(). I finally got my what I wanted, but it wasn't pretty.
There has to be a simple way to use a regular expression to look through a file and get all /*.jar
What is it? And before you answer without
testing your code, be advised, I must have tried 100 things that I was Sure would work, but did not.
Thanks in advance,
Skip