What is wrong with this one?
echo commons-logging.jar | perl -pe 's/(.*?)([^s]+\.jar)/$1 $2/'
commons -logging.jar
I would expect $2 to capture the whole commons-logging.jar?
Especially as
echo commons-logging.jar | perl -pe 's/([^s]+\.jar)/$1/'
commons-logging.jar
The first one says “capture everything non-greedily up until the first character thats not an “s” and put it into $1 (hence $1 = common) and than put everything after that match that ends in “.jar” into $2 (hence $2 = “-logging.jar”).
The second form says “capture everything staring with at least one or more characters that are not an “s” (there4fore the capture begins at “c”) followed by the something that ends in “.jar” (hence you get the whole “commons-logging.jar” in $1)