regex-replacer 0.1.1

Creator: bradpython12

Last updated:

0 purchases

regex-replacer 0.1.1 Image
regex-replacer 0.1.1 Images

Languages

Categories

Add to Cart

Description:

regexreplacer 0.1.1

Regex Replacer
This is simple package for fast replace texts with regex.
Support Rust regex syntax: https://docs.rs/regex/latest/regex/#syntax
Installation
pip install regex_replace --upgrade

Usage
from regex_replacer import RegexReplacerTransformer

transformer = RegexReplacerTransformer([
(r'[0-9]+', " NUMBER "),
(r"[a-z]+", " WORD ")
])
test_strings = [
"this is a SIMPLE TEXT 12345 with number"
]
print(transformer.transform(test_strings))

# Output: [' WORD WORD WORD SIMPLE TEXT NUMBER WORD WORD ']

for multithread transform:
transformer = RegexReplacerTransformer([
(r'[0-9]+', " NUMBER "),
(r"[a-z]+", " WORD ")
], n_jobs=3)

to back to single thread:
transformer.to_single_thread()

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.