https://github.com/gnat/python-replace-case-insensitive
:mag: Case insensitive string replace() alternative for Python 3. Does NOT use regex (regular expressions) in order to prevent ReDoS attacks.
https://github.com/gnat/python-replace-case-insensitive
Last synced: 10 months ago
JSON representation
:mag: Case insensitive string replace() alternative for Python 3. Does NOT use regex (regular expressions) in order to prevent ReDoS attacks.
- Host: GitHub
- URL: https://github.com/gnat/python-replace-case-insensitive
- Owner: gnat
- License: unlicense
- Created: 2020-09-23T04:22:55.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-07-09T19:41:15.000Z (over 3 years ago)
- Last Synced: 2024-12-31T16:50:13.083Z (12 months ago)
- Language: Python
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Case Insensitive replace() for Python
Case insensitive string replace() alternative for Python 3.
Prevents ReDoS attacks by NOT using regex (or re or regular expressions).
* https://en.m.wikipedia.org/wiki/ReDoS
* https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS
## Example
```python
from replace_ci import *
result = replace_ci("Why am I not in the StAnDard LIBRarY?", "standard library", "string library")
print(result)
# Why am I not in the string library?
```
## License
Public domain.