# Welcome to RegEx4Seq
[![CircleCI](https://dl.circleci.com/status-badge/img/gh/sfkleach/lazychains/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/sfkleach/lazychains/tree/main) [![Documentation Status](https://readthedocs.org/projects/lazychains/badge/?version=latest)](https://lazychains.readthedocs.io/en/latest/?badge=latest)
This is a python library that implements regular-expression based pattern matches for sequences of arbitrary objects. For example you can write pattern to determine if a list is a sequence of alternating 1's and 0's like this:
```py
from regex4seq import Item, Items
# The core is a repetition of alternating 0s and 1s. But we need to
# account for the pattern starting on a 1 or finishing on a zero.
# Analogous to the regex /1?[01]*0?/.
pattern = Item(1).optional() & Items(0, 1).repeat() & Item(0).optional()
pattern.matches( [1, 0, 1, 0, 1, 0, 1])
# True
pattern.matches( [1, 0, 1, 0, 1, 0, 0])
# False
```
To learn more about the library, go to [the documentation](https://regex4seq.readthedocs.io) page on ReadTheDocs.
Raw data
{
"_id": null,
"home_page": "https://regex4seq.readthedocs.io/en/latest/",
"name": "regex4seq",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": "regex, regular expressions, pattern matching, sequence matching",
"author": "Stephen Leach",
"author_email": "sfkleach@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/36/8e/28a2367bda68f20065f873b83cd831886d1c230506f639d622367c364729/regex4seq-1.0.1.tar.gz",
"platform": null,
"description": "# Welcome to RegEx4Seq\n\n[![CircleCI](https://dl.circleci.com/status-badge/img/gh/sfkleach/lazychains/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/sfkleach/lazychains/tree/main) [![Documentation Status](https://readthedocs.org/projects/lazychains/badge/?version=latest)](https://lazychains.readthedocs.io/en/latest/?badge=latest)\n\nThis is a python library that implements regular-expression based pattern matches for sequences of arbitrary objects. For example you can write pattern to determine if a list is a sequence of alternating 1's and 0's like this:\n\n```py\nfrom regex4seq import Item, Items\n\n# The core is a repetition of alternating 0s and 1s. But we need to\n# account for the pattern starting on a 1 or finishing on a zero.\n# Analogous to the regex /1?[01]*0?/.\npattern = Item(1).optional() & Items(0, 1).repeat() & Item(0).optional()\n\npattern.matches( [1, 0, 1, 0, 1, 0, 1])\n# True\n\npattern.matches( [1, 0, 1, 0, 1, 0, 0])\n# False\n\n```\n\nTo learn more about the library, go to [the documentation](https://regex4seq.readthedocs.io) page on ReadTheDocs.\n",
"bugtrack_url": null,
"license": "LGPL-3.0-or-later",
"summary": "Regular Expressions for Sequences of Things",
"version": "1.0.1",
"project_urls": {
"Documentation": "https://regex4seq.readthedocs.io/en/latest/",
"Homepage": "https://regex4seq.readthedocs.io/en/latest/",
"Repository": "https://github.com/sfkleach/regex4seq"
},
"split_keywords": [
"regex",
" regular expressions",
" pattern matching",
" sequence matching"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "cbc5dfa6ddbce495022bcfd7c5ac731c1c00e1ab15bc1ee47e00b27908d328e6",
"md5": "e258ce8ab2a51eb977f8755760d87c97",
"sha256": "aae7edfd8215e3ea5825782fd9c74b01a6b48f42e578fb0d18973ba3fd7270e0"
},
"downloads": -1,
"filename": "regex4seq-1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e258ce8ab2a51eb977f8755760d87c97",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 8825,
"upload_time": "2024-04-23T19:33:30",
"upload_time_iso_8601": "2024-04-23T19:33:30.280125Z",
"url": "https://files.pythonhosted.org/packages/cb/c5/dfa6ddbce495022bcfd7c5ac731c1c00e1ab15bc1ee47e00b27908d328e6/regex4seq-1.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "368e28a2367bda68f20065f873b83cd831886d1c230506f639d622367c364729",
"md5": "d8c98e6a918a10d30afe5823ed76ca53",
"sha256": "ee2e510e46dce0ff27fcb7f6bf05e69dd65ec18d7de852f205e6c76ec931ad5a"
},
"downloads": -1,
"filename": "regex4seq-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "d8c98e6a918a10d30afe5823ed76ca53",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 8016,
"upload_time": "2024-04-23T19:33:32",
"upload_time_iso_8601": "2024-04-23T19:33:32.549496Z",
"url": "https://files.pythonhosted.org/packages/36/8e/28a2367bda68f20065f873b83cd831886d1c230506f639d622367c364729/regex4seq-1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-23 19:33:32",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "sfkleach",
"github_project": "regex4seq",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"circle": true,
"lcname": "regex4seq"
}