Metadata-Version: 2.0
Name: rer
Version: 1.1.2
Summary: Regular expression in regular expression
Home-page: https://github.com/jks-liu/rere
Author: Meme Kagurazaka
Author-email: github@mrliu.org
License: Public Domain
Keywords: Nested regular expression re
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries
Classifier: License :: Public Domain
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6

━━━━━━━━
                                 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)])
  └────


