Coder Social home page Coder Social logo

krzysiekruczaj / substring-expressions Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 24 KB

The goal of this project is to provided syntax similar to regular expressions that allows to check if provided expression is part of another string.

Java 59.33% Groovy 40.67%

substring-expressions's Introduction

Substring expressions

Overview

The goal of this project is to provided syntax similar to regular expressions that allows to check if provided expression is part of another string.

Project requirements:

Write a program that takes 2 string parameters from the command line. Program must verify if the second string is a substring of the first string (you cannot use substr, substring or any other standard function including regular expression libraries).

Each occurrence of * in the second substring means that it can be a match for zero or more characters of the first string.

Consider the example:

Input string 1: abcd
Input string 2: a*c

Program should evaluate that the string 2 is a substring of the string 1.

Additionally asterisk (*) may be considered as a regular character, if it is preceded by a backslash (\). Backslash (\) is considered as a regular character in all cases other than preceding the asterisk (*).

Building project

The project can be built with single command:

./gradlew clean fatJar

Usage

java -cp build/libs/substring-expressions-1.0-SNAPSHOT.jar it.ruczaj.expressions.SubstringCheckerMain inputString comparedExpression

Example of usage

java -cp build/libs/substring-expressions-1.0-SNAPSHOT.jar it.ruczaj.expressions.SubstringCheckerMain "1234*a" "1234\**"

substring-expressions's People

Contributors

krzysiekruczaj avatar

Watchers

James Cloos 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.