Answers for "regex in java"

2

regular expression java

//Ther are three type of REGULAR EXPRESSION     
   //first
   ^(.+)@(.+)$   "^(.+)@(.+)$\""
   //second
   ^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,6}$
     //third
   ^[\\w!#$%&'*+/=?`{|}~^-]+(?:\\.[\\w!#$%&'*+/=?`{|}~^-]+)*@(?!-)(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,6}$
Posted by: Guest on June-08-2021
1

regex java

import java.io.*;
import java.util.regex.*;

public class testRegex {

    private static Pattern pattern;
    private static Matcher matcher;

    public static void main(String args[]) {
        pattern = Pattern.compile("Hugo");
        matcher = pattern.matcher("Hugo Etiévant");
        while(matcher.find()) {
            System.out.println("Trouvé !");
        }
    }
}
Posted by: Guest on February-05-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language