Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/numberoverzero/simplex
simple subset of regex that 'compiles' to python regexs
https://github.com/numberoverzero/simplex
Last synced: 17 days ago
JSON representation
simple subset of regex that 'compiles' to python regexs
- Host: GitHub
- URL: https://github.com/numberoverzero/simplex
- Owner: numberoverzero
- License: mit
- Created: 2015-02-10T04:16:42.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-02-18T15:46:58.000Z (over 9 years ago)
- Last Synced: 2024-10-07T09:06:50.853Z (about 1 month ago)
- Language: Python
- Size: 152 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
- License: LICENSE
Awesome Lists containing this project
README
# 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
```python
import simplexpattern = "Hello, [name] (aka [nick])!"
regex = simplex.compile(pattern)string = "Hello, earth (aka world)!"
match = regex.match(string)
print(match.groupdict())```
```python
import simplexpattern = "<[el]>[value][:ref(el)]>"
regex = simplex.compile(pattern)string = "
Hello, World!
"
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