Skip to main content

Regular expression in regular expression

Project description

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


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

1 rer
2 All in one simple function


1 rer
═════

Regular expression in regular expression.


2 All in one simple function
════════════════════════════

┌────
│ import re

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


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

│ This function use regular expression string `re_string' and the group
│ `regroup' (default 0) to match the `data'. This will evaluates a list,
│ a function `item_continuation' will apply to every item of the list,
│ a function `list_continuation' will apply to the list. These 2 functions
│ do nothing 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.
│ """

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


Project details


Download files

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

Source Distribution

rer-1.1.1.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rer-1.1.1-py2.py3-none-any.whl (3.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file rer-1.1.1.tar.gz.

File metadata

  • Download URL: rer-1.1.1.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for rer-1.1.1.tar.gz
Algorithm Hash digest
SHA256 dd97506915403c9764ed0eee617833f1f4e0cb5b28767df4fcb63a21bc53be72
MD5 10366ae825164b895286e8f0c3200b0f
BLAKE2b-256 eeec469a57f49e07b41cc2a5fa0778f72a4ebb69b2774fcf486db5ba488e20fc

See more details on using hashes here.

File details

Details for the file rer-1.1.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for rer-1.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 76649021110a8cfa338fe247bc22b3420c82491da4a1fcc76c2c359893cfafbc
MD5 64d17ab023ebe1b634440f4c0616a856
BLAKE2b-256 1247697aac48824d65214eea5ded38e69c5aaf80dad0a35a62154193b5330f8d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page