Giter Club home page Giter Club logo

regex_matcher's Introduction

Regex Matcher

Matching regular expressions with words or groups of pumping words in Java, Python, Javascript, C++, Go, Rust and measuring time consuming.

Installing

  1. Install packages
sudo apt-get install make default-jdk maven nodejs cargo golang-go python3-pip g++
  1. Set the environment variable export REGEX_MATCHER_ROOT={path}/regex_matcher
  2. Configure files
# go
cd $REGEX_MATCHER_ROOT/src/go
make

# java
cd $REGEX_MATCHER_ROOT/src/java
mvn clean compile; mvn clean package

# rust
cd $REGEX_MATCHER_ROOT/src/rust
make

# c++
cd $REGEX_MATCHER_ROOT/src/cpp
make
  1. Install requirements pip install -r requirements.txt

Matching

usage: main.py [-h] [-v VISUALIZE] [-m] filename

positional arguments:
  filename              path to json file for matching 
                        {
                            'regex': str, (target_file regex), 
                            'word': str, (optional, input to match),
                            'pump': Dict[str, Any], (optional, dictionary of the format:
                            {
                                'attack': List[List[str]|str], (e.g. [["a", "1"], "b", ["a", "1"]])
                                'steps': Dict[str, List[int]], (e.g. {"1": [start, end, step]}, [start, end))
                            }),
                            'languages': List[str], (optional, languages to use, None means all),
                            'target_file': str, (optional, file to save matching results),
                            'encoding': str, (optional, global encoding, defaults to 'utf-8')
                        }

options:
  -h, --help            show this help message and exit
  -v VISUALIZE, --visualize VISUALIZE
                        path to file for dependency visualization
  -m, --multiplot       whether to plot several dependency images

Example

python3 main.py test/test.json -v test/visual.png -m

regex_matcher's People

Contributors

julia-bel avatar

Stargazers

Antonina Nepeivoda avatar Исмагилова Дарья avatar

Watchers

Antonina Nepeivoda avatar  avatar

regex_matcher's Issues

Кроссплатформенность и множественные накачки

Под виндой команды запуска не работают. Когда-нибудь, когда появится возможность и время, желательно поправить на кроссплатформенный вариант.

И ещё, нехорошо, но не хочу заводить ещё одну тему: нужно сделать вариант с многими "областями накачки" (синхронными) для испытания backref-случаев.

Унификация формата регулярок

(я это могу легко сделать в своей тестирующей сборке, но лучше иметь в виду)
Если внешний конструктор - альтернатива, то без внешних круглых скобок регулярка читается неправильно. То есть в нашем тестовом наборе регулярки отформатированы немного не так, как нужно мэтчеру.

Сопроцессы

Если мэтчинг экспоненциальный и строки достаточно длинные, то сопроцессы не успевают и начинают мешать друг другу (как минимум на виндах). Как-то надо разобраться с этими коллизиями, прежде чем делать релиз.

Конфиги вызовов

Желательно ещё написать в readme инструкцию, как собрать все исполняющие машины, и конфиг, в котором можно поменять строки запуска (чуть-чуть подшаманила с Java, т.к. неохота было выставлять perl). У меня сразу всё пересобралось, кроме почему-то rust (который заругался на строку Err(error) => {}, но замена переменной образца на безымянную всё вылечило), благо makefile везде есть. Но сказать о процессе сборки надо.

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.