{ "info": { "author": "Stefano Apostolico", "author_email": "s.apostolico@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.11", "Framework :: Django :: 2.0", "Framework :: Django :: 2.1", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.6" ], "description": "================================\nDjango Regex\n================================\n\n.. image:: https://badge.fury.io/py/django-regex.png\n :target: http://badge.fury.io/py/django-regex\n\n.. image:: https://travis-ci.org/saxix/django-regex.png?branch=master\n :target: https://travis-ci.org/saxix/django-regex\n\n.. image:: https://pypip.in/d/django-regex/badge.png\n :target: https://pypi.python.org/pypi/django-regex\n\n\nFields and utilities to work with regular expression in Django\n\nThe Django regex field provides custom fields and utilities for a Django model that stores a regex.\nThis provides the ability to easily store regex patterns and access them as compiled regular\nexpressions from your models.\n\nPatterns can be expressed in perl syntax to set regex flags.\n\n\nComponents\n----------\n\nRegexField\n~~~~~~~~~~\n\nDjango fields to store regular expressions\n\n.. code-block:: python\n\n class DemoModel(models.Model):\n regex = RegexField(flags=re.I)\n\n\n o = DemoModel.objects.create(regex='^1$')\n o.regex.match('1')\n\nRegexFlagsField\n~~~~~~~~~~~~~~~\n\nAs RegexField but allows to set compilation flags (see: https://docs.python.org/2/howto/regex.html#compilation-flags)\nIt is rendered with proper widget\n\n.. code-block:: python\n\n from django_regex.validators import compress\n import re\n\n class DemoModel(models.Model):\n regex = RegexFlagsField()\n\n o = DemoModel.objects.create(regex=compress(['aa', re.I]))\n o.regex.match('AA')\n\n o = DemoModel.objects.create(regex=compress(['aa', 'i'])) # use human shortcuts\n o.regex.match('AA')\n\n\nRegexFlagsField stores pattern and flags in the same db column as string in the format\n``\n\nseparator is `chr(0)` can be customized using settings `DJANGO_REGEX_SEPARATOR`\nor per each field using `flags_separator` argument.\n\n.. code-block:: python\n\n from django_regex.validators import compress\n import re\n\n class DemoModel(models.Model):\n regex = RegexFlagsField(flags_separator='/')\n\n o = DemoModel.objects.create(regex='aa/i')\n o.regex.match('AA')\n\n\nRegexList\n~~~~~~~~~\nlist that matches content against valid regular expressions\n\n.. code-block:: python\n\n rules = RegexList(['\\d*'])\n 1 in rules # True\n '1' in rules # True\n 'a' in rules # False\n\n\n\nLinks\n~~~~~\n\n+--------------------+----------------+--------------+----------------------------+\n| Stable | |master-build| | |master-cov| | |\n+--------------------+----------------+--------------+----------------------------+\n| Development | |dev-build| | |dev-cov| | |\n+--------------------+----------------+--------------+----------------------------+\n| Project home page: |https://github.com/saxix/django-regex |\n+--------------------+------------------------------------------------------------+\n| Issue tracker: |https://github.com/saxix/django-regex/issues?sort |\n+--------------------+------------------------------------------------------------+\n| Download: |http://pypi.python.org/pypi/django-regex/ |\n+--------------------+------------------------------------------------------------+\n\n\n.. |master-build| image:: https://secure.travis-ci.org/saxix/django-regex.png?branch=master\n :target: http://travis-ci.org/saxix/django-regex/\n\n.. |master-cov| image:: https://codecov.io/gh/saxix/django-regex/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/saxix/django-regex\n\n.. |dev-build| image:: https://secure.travis-ci.org/saxix/django-regex.png?branch=develop\n :target: http://travis-ci.org/saxix/django-regex/\n\n.. |dev-cov| image:: https://codecov.io/gh/saxix/django-regex/branch/develop/graph/badge.svg\n :target: https://codecov.io/gh/saxix/django-regex", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/saxix/django-regex", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-regex", "package_url": "https://pypi.org/project/django-regex/", "platform": "linux", "project_url": "https://pypi.org/project/django-regex/", "project_urls": { "Homepage": "https://github.com/saxix/django-regex" }, "release_url": "https://pypi.org/project/django-regex/0.4.1/", "requires_dist": null, "requires_python": "", "summary": "Fields and utilities to work with regular expression in Django", "version": "0.4.1" }, "last_serial": 5699078, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "13ed67b430cf191463b871c6121b130d", "sha256": "f2522da8778517b9b5883cc3d53d2e1d01f7d2763f26fc96f6f64a668678ca47" }, "downloads": -1, "filename": "django-regex-0.1.0.tar.gz", "has_sig": false, "md5_digest": "13ed67b430cf191463b871c6121b130d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17745, "upload_time": "2018-01-24T13:34:55", "url": "https://files.pythonhosted.org/packages/c1/07/9b07cf31f7cc510d41992066b069a3794bb0fd1a90338d56ca02bf5f5a35/django-regex-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "c47538da273c231646d122769980b78f", "sha256": "6cba87cc6758d1bed1c7f6e0b30122b3b0dfdf1ebdeec670bf329398a8fdae51" }, "downloads": -1, "filename": "django-regex-0.2.0.tar.gz", "has_sig": false, "md5_digest": "c47538da273c231646d122769980b78f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23399, "upload_time": "2018-02-01T18:35:40", "url": "https://files.pythonhosted.org/packages/91/80/709964d40108de120d8995658b362e326b956bb3366db5a8eca1211ea866/django-regex-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "0a60750034b7ff9435777c9cba491fc0", "sha256": "a4508894b49dd35e49acfbb8ee1046913ebe375ecbecebf64d30ffb9b4be6f2b" }, "downloads": -1, "filename": "django-regex-0.2.1.tar.gz", "has_sig": false, "md5_digest": "0a60750034b7ff9435777c9cba491fc0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23461, "upload_time": "2018-02-01T20:30:41", "url": "https://files.pythonhosted.org/packages/c7/98/da5992abd5958de6231998d5b227b2abde2556702a0abc6c695c336e7c38/django-regex-0.2.1.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "23a3200cbe9c2673d517643a0cbcb08b", "sha256": "41bf21c4de1a78eb791297851a7f97057671455627cc1ed8dc04eead5ea791c9" }, "downloads": -1, "filename": "django-regex-0.4.tar.gz", "has_sig": false, "md5_digest": "23a3200cbe9c2673d517643a0cbcb08b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24297, "upload_time": "2019-08-19T15:35:28", "url": "https://files.pythonhosted.org/packages/d4/0e/71176c565202bc723d97569717043c661c90027191581b4ff5d139d0e109/django-regex-0.4.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "26705b209b4f21c1dc1ded3b1d7390f2", "sha256": "3f85f4611a921299b86614591fb7b82201d1748ac6207b358bd8b1f2d2289513" }, "downloads": -1, "filename": "django-regex-0.4.1.tar.gz", "has_sig": false, "md5_digest": "26705b209b4f21c1dc1ded3b1d7390f2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25623, "upload_time": "2019-08-19T15:40:22", "url": "https://files.pythonhosted.org/packages/01/ef/941f7b3057074e92ba554f51efbb5639cfdb2c0dde0eebe2f86df770973e/django-regex-0.4.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "26705b209b4f21c1dc1ded3b1d7390f2", "sha256": "3f85f4611a921299b86614591fb7b82201d1748ac6207b358bd8b1f2d2289513" }, "downloads": -1, "filename": "django-regex-0.4.1.tar.gz", "has_sig": false, "md5_digest": "26705b209b4f21c1dc1ded3b1d7390f2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25623, "upload_time": "2019-08-19T15:40:22", "url": "https://files.pythonhosted.org/packages/01/ef/941f7b3057074e92ba554f51efbb5639cfdb2c0dde0eebe2f86df770973e/django-regex-0.4.1.tar.gz" } ] }