Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
This is a simple package to make regular expressions in Python.
pip install mre
from mre import Regex, Group
rgx_one = Regex("Hello world") # Hello world
rgx_two = Regex("Hello", " world") # Hello world
rgx_three = Regex("Hello") + " " + Regex("world") # Hello world
rgx_four = Regex('<', Group('h[1-6]'), '>') # <(h[1-6])>
rgx_five = Regex('<', Regex.SLASH, 1, '>') # <\/\1>
from mre import Set
from mre.helper import Range
# All digits
digits = Set(Range(0, 9))
# Add comment
digits = digits.comment('Get all digits')
# Output: [0-9](?#Get all digits)
from mre import Regex, Set, Comment
# All digits
digits = Set(Regex("0-9"))
# CEP comment
cep_comment = Comment('Get zip code Brazil on input')
# CEP regex
rgx_cep = Regex(
digits.quantifier(5),
Regex("-").quantifier(0, 1),
digits.quantifier(3),
cep_comment
)
# Output: [0-9]{5}-?[0-9]{3}(?#Get zip code Brazil on input)
To test the package just run the following command:
# (first time only) Build the Docker image
make build
# Run tests
make test
# Run tests and check coverage
make test-coverage
Contributions are more than welcome. Fork, improve and make a pull request. For bugs, ideas for improvement or other, please create an issue.
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
Maker Regular Expressions
We found that mre demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.