Here you can find the source of truncateVersionFromModFileName(List
static List<String> truncateVersionFromModFileName(List<String> fileNames)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { static List<String> truncateVersionFromModFileName(List<String> fileNames) { String pattern = "([a-zA-Z0-9\\s-]+)([-_\\s\\[])(.+)(.jar)"; List<String> truncatedNames = new ArrayList<>(); for (String fileName : fileNames) { String newName = fileName.replaceAll(pattern, "$1"); truncatedNames.add(newName.trim()); }/*from www. j ava2 s. c om*/ return truncatedNames; } }