Git Product home page Git Product logo

regular-expressions-validator's Introduction

Regular Expression Validator

Validate if a given string matches a regular expresssion.

  • Checks for the validity of the Regular Expression using **Cocke-Younger-Kasami (CYK) Algorithm **
  • Constructs an equivalent Non-Deterministic Finite Automaton (NFA)
  • Check if the input strings are a part of the language defined by the given regular expression.

Input:

First line of the input is a regular expression string R (0 < |R| < 100). Second line is an integer N (0 < N < 1000) represents total number of names following. N lines gives the names of the people. The name is a string S(0 < |S| < 100000).

The regular expression will be valid if it satisfies the following conditions

  1. The valid operations are concatenation(.), union(+) and closure(*).
  2. Each basic expression will be one of the form (a+b) or (a*) or (a.b).
  3. The final expression can be a recursive use of basic expressions. Some examples of valid regular expressions ((a*).b) , (((a.b)+b)*) ,etc.

Output:

If the Regular expression is not valid , output ”Wrong Expression”. Otherwise output N lines of ”Yes” or ”No” each corresponding to whether the string matches or not.

regular-expressions-validator's People

Contributors

uday96 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.