Find all digits in a string using a regex

The java code below will show how to retrieve all digits from a string using a regular expression.

Straight up Java

@Test
public void test() {
    String digits = "abc123-abc123_abc123".replaceAll("\\D", "");

    assertEquals("123123123", digits);
}