Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2015
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. public static final String new_price = "((?:[0-9]{1,3}[\.,]?)*[\.,]?[0-9]+)";
  2.  
  3. final Pattern p = Pattern.compile(new_price, 0);
  4. final Matcher m = p.matcher(label);
  5. if (m.matches()) {
  6. Log.d(TAG, "found! good start");
  7. if (m.groupCount() == 1) {
  8. Log.d(TAG, "start match price" + " : " + m.group(0));
  9. }
  10. if (m.groupCount() == 2) {
  11. Log.d(TAG, "start match price" + " : " + m.group(1));
  12. }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement