This url link is valid https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8# need to remove all numeric characters, and that the output of the link was after the first character ? and separated by the parameters = or - , the output of the link should be sourceid chrome instant ion espv ie UTF . I want to solve through regular expressions, so far I could only remove all the characters.
String url = "https://www.google.ru/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8# "; String regexp1 = "([?\\.\\&\\:\\;\\/\\=\\-\\#]+)"; // используем Паттерн, компилируем регулярное выражение Pattern pattern1 = Pattern.compile(regexp1); // делаем матчер по созданному паттерну и кидаем в конструктор наш URL. Matcher matcher1 = pattern1.matcher(url); String output = matcher1.replaceAll(" "); System.out.println(output);