SHARE
TWEET

Untitled

a guest Jun 17th, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4. import java.util.regex.*;
  5.  
  6. class Ideone {
  7.   public static void main (String[] args) throws java.lang.Exception {
  8.     Pattern pattern = Pattern.compile("\d{4,5}");
  9.     Matcher matcher = pattern.matcher("22 Код - 3653 и ещё код 45678");
  10.  
  11.     while (matcher.find()) {
  12.       int x = Integer.parseInt(matcher.group());
  13.       System.out.println(x);
  14.     }
  15.   }
  16. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top