Skip to main content

Regular Expressions for Sequences of Things

Project description

Welcome to RegEx4Seq

CI Documentation Status

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:

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 page on ReadTheDocs.

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

regex4seq-2.0.0.tar.gz (58.3 kB view details)

Uploaded Source

Built Distribution

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

regex4seq-2.0.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file regex4seq-2.0.0.tar.gz.

File metadata

  • Download URL: regex4seq-2.0.0.tar.gz
  • Upload date:
  • Size: 58.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for regex4seq-2.0.0.tar.gz
Algorithm Hash digest
SHA256 1aa2156ab1d723ce7789ac9023f0f09deaa91ba5b2e6437f325def5d06fd0842
MD5 61ee31c69f4e32b803eb6183e9f798d5
BLAKE2b-256 89eee396940053348f610c139512a779f1d14f9e778b2324be2447d9c8bc9746

See more details on using hashes here.

File details

Details for the file regex4seq-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: regex4seq-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for regex4seq-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a9884c175de56f6cb8e3b8d6ae2cde121f6f91617ce0aec8bc8d4a934c94364e
MD5 3971382de5d8702e6d0728fe2c135beb
BLAKE2b-256 0db55bf72978e24d0b73c056a81d1dec7ddf2c715d1b62066bf8fb06b99e0fbc

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