Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package regex.com;
- import java.util.regex.Matcher;
- import java.util.regex.Pattern;
- public class Regex {
- public static String toPrice(String text) {
- text = text.replace(",","");
- Pattern p = Pattern.compile("[\\d.]+\\d");
- Matcher m = p.matcher(text);
- String price = "";
- while (m.find()) {
- return m.group();
- }
- return "not found price";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement