Regecks
A regex engine built from scratch using python, and a TUI using Textual!
Ever part of this including stuff like the lexer, parser, the ast, and the backtracking were written by hand :)
Installation
Requires uv
git clone https://github.com/kashsuks/regecks
cd regecks
uv sync
Running
uv run regecks
Keybindings
| Key | Action |
|---|---|
| Tab | Move between pattern and test string fields |
| Ctrl+R | Run match manually |
| Ctrl+C | Quit |
Matches get updated live
Supported Syntax
Literals
| Pattern | Match |
|---|---|
| a | The character a |
| abc | The string abc exactly |
Wildcard
| Pattern | Match |
|---|---|
| . | Any single character except newline |
Quantifiers
All quantifiers are greedy and therefore consume as much as possible.
| Pattern | Match |
|---|---|
| a* | Zero or more a |
| a+ | One or more a |
| a? | Zero or one a |
| a{3} | Exactly 3 a |
| a{2,} | 2 or more a |
| a{2,4} | Between 2 and 4 a (inclusive) |
Anchors
| Pattern | Match |
|---|---|
| ^abc | abc only at the start of the string |
| abc$ | abc only at the end of the string |
| \b | Word boundary (between \w and \W) |
| \B | Non-word boundary |
Character classes
| Pattern | Match |
|---|---|
| [abc] | Any one of a, b, or c |
| [a-z] | Any lowercase letter |
| [A-Z0-9] | Any uppercase letter or digit |
| [^abc] | Any character except a, b, c |
| [^0-9] | Any non-digit |
Escape sequences
| Pattern | Match |
|---|---|
| \d | Any digit [0-9] |
| \D | Any non-digit |
| \w | Any word character [a-zA-Z0-9_] |
| \W | Any non-word character |
| \s | Any whitespace (space, tab, newline, etc) |
| \S | Any non-whitespace |
| \n | Newline |
| \t | Tab |
| \n | Literal dot (escaping special chars) |
Alternation
| Pattern | Match |
|---|---|
| cat|dog | Either cat or dog |
| foo|bar|baz | Any of the three |
Groups
| Pattern | Match |
|---|---|
| (abc) | abc, captured as group 1 |
| (a)(b) | ab, with a as group 1 and b as group 2 |
| (?:abc) | abc, not captured |
| (?Pabc) | abc, captured as named group name |
Flags
| Pattern | Match |
|---|---|
| (?iabc) | Match abc case-insensitively and matches ABC, abc, etc. |
The flags wrap everything that follows it in a pattern
Lookahead and lookbehind
These are zero-width assertions meaning they check for a condition without consuming characters.
Metadata
Release files for regecks 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| regecks-0.1.1.tar.gz | 19.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| regecks-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 34.0 kB
Release files / regecks-0.1.1.tar.gz
| Download URL | regecks-0.1.1.tar.gz |
|---|---|
| Size | 19.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c88f25d55bfe30f0e47e67dfcd5a17241af8fe6f7c4eb36720a4e7891298ca82
|
|
BLAKE2b-256 checksum How to use checksums |
307b82608f48f5f31400e80497efea6a5d0c1dec0f92ea7cc8b2bf0be1bb23b3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.4
|
Release files / regecks-0.1.1-py3-none-any.whl
| Download URL | regecks-0.1.1-py3-none-any.whl |
|---|---|
| Size | 14.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
da53f1f2d028e2d83189e7bd422459c17fef8e7eada4de639c40133ef601b160
|
|
BLAKE2b-256 checksum How to use checksums |
2df1814ba9c63d87012f236b6d0f49975def3cf20a697488c257ade2ae89385d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.4
|
Security for regecks 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.