No project description provided
Project description
Regex Rewriter
Overview
The Regex Rewriter is a tool designed to manipulate text based on regular expressions.
Installation
pip install RegexRewriter
Usage
from RegexRewriter import RegexRewriter
rewriter = RegexRewriter()
print(rewriter.rewrite("hello", r"[a-z]{3}[A-Z]{2}")) # Should output: helLO
print(rewriter.rewrite("test", r"[0-9]{2}[a-z]{2}")) # Should output: 00es or similar
print(rewriter.rewrite("hello", r"^pre_[A-Z][a-z]+$")) # Should output: pre_Hello
print(rewriter.rewrite("hello world", r"^[A-Z][a-z]+ [a-z]+$")) # Should output: Hello world
print(rewriter.rewrite("example", r"https?:\/\/[\w\-\.]+\.[a-z]{2,}")) # Should add protocol & TLD
print(rewriter.rewrite("wrong", r"(right|correct|valid)")) # Should transform to one of the alternatives
License
This project is open-source and available for modification and distribution under the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
regexrewriter-0.1.1.tar.gz
(6.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file regexrewriter-0.1.1.tar.gz.
File metadata
- Download URL: regexrewriter-0.1.1.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7cf85edfab7c160b38bbec6fc33db618259e777fd9e1578388df47f8176d491a
|
|
| MD5 |
a4e580febabfdce5ebaaad104be8f076
|
|
| BLAKE2b-256 |
9aad8e672dbffd3590f8406fb2ae765ae5d0160517cd7172c07e466afbd2c033
|
File details
Details for the file RegexRewriter-0.1.1-py3-none-any.whl.
File metadata
- Download URL: RegexRewriter-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2600af6ac5ac53b3ecc9233623efa23b2a22c9e480df892dee285e99df1abec3
|
|
| MD5 |
3b166c7e475f252c2d4585c4332b8d8e
|
|
| BLAKE2b-256 |
a6a392dcd13148065672c95b1a39fb1a80e63c2e83e9b4a4b3beae822a810158
|