java separate the numbers from string

https:‮/‬/www.lautturi.com
java separate the numbers from string
/**
 * @author lautturi.com 
 * Java example: Extract a number from a string in java
 */

import java.util.*;
import java.util.regex.Pattern;

public class Lautturi {
	public static void main(String[] args) {
		String str = "The price is $39";
        
        String price = str.replaceAll("[^0-9]", "");
        System.out.println(price);
		
	}
}

output:

39
Created Time:2017-10-09 15:51:19  Author:lautturi