GithubHelp home page GithubHelp logo

monksc / regexsentenses Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 8 KB

This program takes in a regex expression and outputs all possible sentences that match the expression.

License: MIT License

Makefile 1.68% Lex 5.01% Yacc 39.97% C 53.34%
regex regex-pattern

regexsentenses's Introduction

regexsentenses

This program takes in a regex expression and outputs all possible sentences that match the expression.

Quick Set Up

make install
regexsentenses "[0-9A-F]{1:3}\n"

Examples

To make random css

regexsentenses "\.[a-z]{3}\{\n\t[(background\-color)(color)]: #[0-9A-F]{6};\n\}\n"

Cracking John Smiths super secret password

regexsentenses "[jJ]ohn[sS]mith[0-9]{0:2}[!@#$%]{0:1}\n" | \
    xargs -P0 -I % sh -c \
        'if [ "$(echo '%' | openssl dgst -hex -sha256)" = "55fc540c73118d224e8fa3523761ddde0a6d626d18896bea6afb2eb748c00b78" ]; then echo '%'; fi'

To calculate the total of all possible combination of 3 digits including an empty character

echo $(regexsentenses '\[\([0-9]{1:3}\\\+\)\]')"0\n" | regexsentenses | bc

To print all numbers starting with 0 or 1

regexsentenses "[1-9][0-9]*\n"
regexsentenses "[0-9]+\n"

Test all possibilities to a regex expression

regexsentenses "if *\(.*\)\{\n"
regexsentenses -c 2 "for[ \t\n]+\([ \t\n]*int[ \t\n]+i[ \t\n]*=[ \t\n]*0[ \t\n]*;[ \t\n]*i[ \t\n]*<[a-zA-Z0-9 \t\n]*;[ \t\n]*i[ \t\n]*\+\+[ \t\n]*;[ \t\n]*\)[ \t\n]*\{\n"

Install

Install to /usr/local/bin/

make install

Uninstall

make uninstall

Build

make build

Clean

make clean

Run Through Make

echo "[0-9A-F]+\n" | make run clean

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.