| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This is a simple regular expression (RegEx) algorithm developed with python.
It supports:
To run a string against the regular expression, create a new object of RegEx with the expression or the pattern as its parameter.
Then by using the match function of the RegEx object pass the string as its parameter and get the result.
from regex import RegEx
re = RegEx("[a-z0-9]@[a-z].(com|net|org)")
result = re.match("hello99@gmail.com")
# output: True
result = re.match("Hello99@gmail.com")
# output: False
result = re.match("Hello99@gmailcom")
# output: FalseThere are some test cases in tests.py file. Use the below code to run the test cases.
python tests.py| Back | FazBrowse Home | New Git URL |