Skip to main content

Posts

Showing posts with the label RegEx

Java Regex Hackerrank Solution

 Java Regex Hackerrank Solution For Explanation Watch Video: Sample Input 000.12.12.034 121.234.12.12 23.45.12.56 00.12.123.123123.123 122.23 Hello.IP Sample Output true true true false false false Code: import  java.util.regex.Matcher; import  java.util.regex.Pattern; import  java.util.Scanner; class  Solution{      public   static   void  main(String[] args){         Scanner in =  new  Scanner(System.in);          while (in.hasNext()){             String IP = in.next();             System.out.println(IP.matches( new  MyRegex().pattern));         }     } } //Write your code here class MyRegex{   ...

Day 28: RegEx, Patterns, and Intro to Databases Hackerrank Solution Java

 Day 28: RegEx, Patterns, and Intro to Databases  For Explanation Check Video: Sample Input 6 riya riya@gmail.com julia julia@julia.me julia sjulia@gmail.com julia julia@gmail.com samantha samantha@gmail.com tanya tanya@gmail.com Sample Output julia julia riya samantha tanya Code: import  java.io.*; import  java.math.*; import  java.security.*; import  java.text.*; import  java.util.*; import  java.util.concurrent.*; import  java.util.regex.*; public   class  Solution {      private   static   final  Scanner scanner =  new  Scanner(System.in);      public   static   void  main(String[] args) {          int  N = scanner.nextInt();         scanner.skip( "(\r\n|[\n\r\u2028\u2029\u0085])?" );         ...