Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

Regular expression in regular expression

Project description

━━━━━━━━
README
━━━━━━━━


Table of Contents
─────────────────

1 rer
2 Install
3 All in one simple function


1 rer
═════

Regular expression in regular expression.


2 Install
═════════

`pip install rer'


3 All in one simple function
════════════════════════════

┌────
│ import re

│ __version__ = '1.1.2'
│ __author__ = 'Meme Kagurazaka'
│ __license__ = 'Public Domain'


│ def rer(re_string, re_group=0,
│ item_continuation=lambda _: _, list_continuation=lambda _: _,
│ re_continuation=None):
│ """rer atom

│ This function use regular expression string `re_string' and the group
│ `re_group' (default 0) to match the `data'. This will evaluates a list,
│ a function `re_continuation' will apply to every match of the list,
│ a function `list_continuation' will apply to the list. `list_continuation'
│ does nothing by default.

│ `re_continuation' applies `item_continuation' to `re_group' by default.

│ Return value is a function which can be apply to the `data'.
│ Return value can also be used as a `item_continuation' or
│ `list_continuation' of another rer recursively.
│ """

│ if re_continuation is None:
│ re_continuation = lambda _: item_continuation(_.group(re_group))

│ return lambda x: list_continuation(
│ [re_continuation(_) for _ in re.compile(re_string).finditer(x)])
└────


Project details


Release history Release notifications

This version
History Node

1.1.2

History Node

1.1.1

History Node

1.0.1

History Node

0.0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
rer-1.1.2-py2.py3-none-any.whl (3.8 kB) Copy SHA256 hash SHA256 Wheel py2.py3 Apr 3, 2017
rer-1.1.2.tar.gz (2.1 kB) Copy SHA256 hash SHA256 Source None Apr 3, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page