daily pastebin goal
33%
SHARE
TWEET

Untitled

a guest Oct 12th, 2017 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package patterns;
  2.  
  3. import java.util.*;
  4. import java.util.regex.*;
  5.  
  6. public class Patterns {
  7.  
  8.     public static void main(String[] args) {
  9.         Patterns Caller = new Patterns();
  10.         Caller.Pattern();
  11.     }
  12.  
  13.     protected void Pattern() {
  14.         Scanner Scanner = new Scanner(System.in);
  15.  
  16.         System.out.println("1");
  17.         String OurText = Scanner.nextLine();
  18.         System.out.println("2");
  19.         String OurText2 = Scanner.nextLine();
  20.  
  21.         String text = " I have a friend named John.";
  22.         String texti = "My name is John ";
  23.  
  24.         System.out.println("whatcha lookin fo");
  25.         String Pat = Scanner.next();
  26.         String pattern = ".*" + Pat + ".*";
  27.  
  28.         boolean matches = Pattern.matches(pattern, OurText + OurText2);
  29.  
  30.         System.out.println("matches = " + matches);
  31.        
  32.     }
  33.  
  34. }
RAW Paste Data
Top