fork(6) download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4. import java.util.regex.Pattern;
  5. import java.util.regex.Matcher;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12.  
  13. Pattern pattern = Pattern.compile("\\d+(?:\\.\\d+)?");
  14. String str="INR100INRINR20.500INR";
  15. Matcher matcher = pattern.matcher(str);
  16. if(matcher.find()){
  17. System.out.println(matcher.group());
  18. }
  19. }
  20. }
Success #stdin #stdout 0.07s 380224KB
stdin
Standard input is empty
stdout
100