GithubHelp home page GithubHelp logo

pombredanne / simplex Goto Github PK

View Code? Open in Web Editor NEW

This project forked from numberoverzero/simplex

0.0 1.0 0.0 156 KB

simple subset of regex that 'compiles' to python regexs

License: MIT License

Python 100.00%

simplex's Introduction

simplex 0.1.2

Downloads https://pypi.python.org/pypi/simplex

Source https://github.com/numberoverzero/simplex

simple subset of regex that 'compiles' to python regexs

Installation

pip install simplex

Getting Started

import simplex

pattern = "Hello, [name] (aka [nick])!"
regex = simplex.compile(pattern)

string = "Hello, earth (aka world)!"
match = regex.match(string)
print(match.groupdict())
import simplex

pattern = "<[el]>[value]</[:ref(el)]>"
regex = simplex.compile(pattern)

string = "<h1>Hello, World!</h1>"
match = regex.match(string)
print(match.groupdict())

Versioning and RFC2812

  • Simplex follows semver for its public API.

    • Currently, compile is the only public function of simplex.
    • You should not rely on the internal api staying the same between minor versions.
    • Over time, private apis may be raised to become public. The reverse will never occur.

Contributing

Contributions welcome! Please make sure tox passes (including flake8) before submitting a PR.

Development

simplex uses tox, pytest and flake8. To get everything set up:

# RECOMMENDED: create a virtualenv with:
#     mkvirtualenv simplex
git clone https://github.com/numberoverzero/simplex.git
pip install tox
tox

API

compile(pattern)

TODO: document the rules for compiling patterns

simplex's People

Contributors

numberoverzero avatar

Watchers

 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.