Skip to main content

A simple lib for generate regex string

Project description

A a simple lib to create string by regex


from regstring import pyregstring

r = b"(?<action>\\w+)\\s(?<url>\\S+)\\s(?<version>\\S+)\r\n"

rs = pyregstring()

if (rs.parse_regex(r)):
    rs.set(b"action", b"GET")
    rs.set(b"url", b"/test")
    rs.set(b"version", b"HTTP/1.1")
b'GET /test HTTP/1.1\r\n'
[b'action', b'url', b'version']

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

regstring-1.0.2.tar.gz (32.4 kB view hashes)

Uploaded source

Supported by

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