1.Introduction about Regex

shalya21 profile image Ayush Shalya ・1 min read

Regular expression is a sequence of characters used for searching of pattern or matching of pattern.
e.g : Regex Pattern :- Java
Test String :- Java , C and Python all are programming languages.

Sample code in java :

import java.io.;
import java.util.Scanner;
import java.util.regex.
class RegexSearch {
public void Pattern (String Regex_Pattern){
Scanner sc = new Scanner (System.in);
String Test_String = sc.nextLine();
Pattern p = Pattern.compile(Regex_Pattern);
Matcher m = p.matcher(Test_String);
public class Main{
public static void main(String[] args){
RegexSearch obj = new RegexSearch();

Input: Java , C and python all are programming languages.
Output: true

You can view code here also.
Have a nice day , Coders.

Posted on by:

shalya21 profile

Ayush Shalya


I am a B.Tech student and I love to share my knowledge with everyone in a very simple an easy way.


markdown guide