{ "info": { "author": "Karol Kuczmarski", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Testing", "Topic :: Text Processing :: General" ], "description": "unmatcher\n=========\n\n*unmatcher* tries to solve the following problem:\n\n *Given a regular expression, find any string that matches the expression.*\n\nWhy? Mostly just because. But one possible application is to generate test data for string processing functions.\n\n\nStatus\n~~~~~~\n\n|Version| |License| |Build Status|\n\n.. |Version| image:: https://badge.fury.io/py/unmatcher.png\n :alt: PyPI package version\n :target: http://badge.fury.io/py/unmatcher\n.. |License| image:: https://img.shields.io/pypi/l/unmatcher.svg?style=flat\n :target: https://github.com/Xion/unmatcher/blob/master/LICENSE\n :alt: License\n.. |Build Status| image:: https://secure.travis-ci.org/Xion/unmatcher.png\n :alt: Build Status\n :target: http://travis-ci.org/Xion/unmatcher\n\nMost typical elements of regexes are supported:\n\n* multipliers: ``*``, ``+``\n* capture groups: ``|``, ``( )`` (including backreferences)\n* character classes (``\\d|\\w|\\s`` etc.) and character sets (``[]``)\n\n\nAPI\n~~~\n\n``unmatcher`` module exposes a single ``reverse`` function.\nIt takes a regular expression - either in text or compiled form - and returns a random string that matches it::\n\n >>> import unmatcher\n >>> print unmatcher.reverse(r'\\d')\n 7\n\nAdditional arguments can be provided, specifying predefined values for capture groups\ninside the expression. Use positional arguments for numbered groups (``'\\1'``, etc.)::\n\n >>> import unmatcher\n >>> print unmatcher.reverse(r'<(\\w+)>.*\\1>', 'h1')\n