fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.regex.*;
  4.  
  5. /* Name of the class has to be "Main" only if the class is public. */
  6. class Ideone
  7. {
  8. public static void main (String[] args) throws java.lang.Exception
  9. {
  10. String input = "یبسب به یبیسب ٩٥٧,٠٩٠*+ ذرزذر بللبل ٢٤٧,٠٠٠";
  11. String regex = "([\u0660-\u0669]+)";
  12. Pattern pat = Pattern.compile(regex);
  13. Matcher mat = pat.matcher(input);
  14. while(mat.find()) {
  15. System.out.println(mat.group());
  16. }
  17. }
  18. }
Success #stdin #stdout 0.05s 711168KB
stdin
Standard input is empty
stdout
٩٥٧
٠٩٠
٢٤٧
٠٠٠