Quantcast
Channel: Solved » regex
Viewing all articles
Browse latest Browse all 14

Match Space in Regex Java

$
0
0

The Java API for regular expressions states that \s will match whitespace. So the regex \\s\\s should match two spaces. Pattern whitespace = Pattern.compile("\\s\\s"); matcher = whitespace.matcher(modLine); while (matcher.find()) matcher.replaceAll(" "); The aim of this is to replace all instances … Continue reading

The post Match Space in Regex Java appeared first on Solved.


Viewing all articles
Browse latest Browse all 14

Trending Articles