Git Product home page Git Product logo

regexprogram's Introduction

Practice Regular Expressions

This is a simple C++ application which allows you to practice creating regular expression patterns. We have provided 10 prompts which cover a variety of regular expression pattern usages. With this program, you can modify the prompts we have provided and also create your own prompts to solve. This program will highlight which characters match the regular expression pattern that you type in and will not allow continuing to the next problem until the current problem is solved correct.

alt text

Building and running

Required libraries: C++11, Curses Library, Boost Library

After downloading/cloning this repository, perform the following commands:

$ make      # builds the program
$ ./regex   # runs the program

Interface

Input Description
Arrow keys/mouse Move between Regex pattern: and Replace with:
Mouse Toggles Extended regex and Global Tag checkboxes.
Ctrl+E Toggles Extended regex checkbox.
Ctrl+G Toggles Global Tag checkbox.
Ctrl+C Exits the program.
Onscreen Description
TASK Tells you what you should try and accomplish for that level. This will change to indicate that the problem is solved correctly.
HINT Provides a hint.

Making your own problems

Create a blank text file with a number, preferrably starting with one greater than the largest number problem. (For example, adding an 11th question would result in creating a file called "problem11")

Use the following format:

Flag Description
--prompt This is where your prompt goes.
--line Each line of these are the possible strings/complete lines/sentences/etc. to capture.
--match Indicates a string matching problem (as opposed to a replace or capture problem). Each line indicates whether or not a regex should match that corresponding string/sentence. A blank line indicates not matching, anything else indicates matching.
--capture Indicates a string capture problem (as opposed to a replace or matching problem). Each line corresponds to the capture groups that are captured by the regex. These lines indicate what should be captured by \0 or the entire regex. Following --n lines are what should be captured by the corresponding capture groups (backreferencing) i.e. \1 \2
--replace Indicates a replace problem (as opposed to a find problem). Each line indicates what the capture and replace regex should return.

Refer to the provided prompts if you need assistance.

TODOs

Create a "main menu" or pass the program parameters to indicate levels/difficulty
Create additional levels
Improve the gui to be more clear and helpful

Known bugs

regexprogram's People

Contributors

liniarc avatar thinkaliker avatar ummekulsum123 avatar jelf avatar lethargilistic avatar mnp 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.