Regular Expressions in Java
`Pattern` and `Matcher` from `java.util.regex`.
Easy
var m = Pattern.compile("(\\d+)mA").matcher(text);
while (m.find()) System.out.println(m.group(1));
Compile patterns once and reuse them.
Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.
Discussion (0)
Sign in or join free to ask questions and discuss this topic.