Skip to main content

Generate regex using python that can fit your needs

Project description

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

Regex Engine

An awesome package to generate regex
Read Documentation
Report Bug · Request Feature

Table of Contents

About The Project

Generating regex can sometimes be complicated. That is why we are introducing this package to help you get things done.

Supported functionalities :

  • Regex Generation for Numerical Range

What does each functionalities do?

1. Regex Generation for Numerical Range

Generate regex given a numerical range, So when given a new number between this range the regex will match.

Person who has motivated me to start this repository is listed in the acknowledgments.

Coded With Language

Getting Started

Simply install the package, import it in your python code and run the method needed. Look at the docstring or source code to understand what is happening.

Prerequisites

Python 3.6 or greater

Installation

pip install regex-engine

Usage

1. Regex Generation for Numerical Range

You get what you give : If given numbers are integers you get a regex that will only match with integer and if floating-point numbers are given it only match with floating-point number.

Supports integer and floating-point numbers. It can even be a negative range.

from regex_engine import generator
generate = generator()
regex1 = generate.numerical_range(5,89)
regex2 = generate.numerical_range(81.78,250.23)
regex3 = generate.numerical_range(-65,12)

Example regex generated for 25-53

^([3-4][0-9]|2[5-9]|5[0-3])$

The regex might not be optimal but it will surely serve the purpose.

The problem of checking a number is within a range might have been simple if you didn't choose the regex path.
if a <= your_input_number <=b would have simply solved the same problem.

We dedicate this method in the package to the people who are pursuing a different path or thinking out of the box.

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Raj Kiran P - @raj_kiran_p - rajkiranjp@gmail.com
GitHub : https://github.com/raj-kiran-p
Website : https://rajkiranp.com

Acknowledgements

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

regex_engine-1.1.0.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

regex_engine-1.1.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file regex_engine-1.1.0.tar.gz.

File metadata

  • Download URL: regex_engine-1.1.0.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8

File hashes

Hashes for regex_engine-1.1.0.tar.gz
Algorithm Hash digest
SHA256 4094996c56711e1093ea4c0dbd119e9624b3102bb6b726fc7c5258c410370118
MD5 93224798a672619fcaefb441efcf918a
BLAKE2b-256 9667fe975e6e2ed3cc6e4e495901d01d08293a6a29dad1d5a6c0ef9f90364c00

See more details on using hashes here.

File details

Details for the file regex_engine-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: regex_engine-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8

File hashes

Hashes for regex_engine-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 662641f34122fcd2d60fe4f29b2861741888645c30c6dfd866f08adbe669c67d
MD5 9baff2eab19a963071adf4e9d5451d9b
BLAKE2b-256 2ab541bdb67b87e62c988401abf8a422d2d2036711209d0d9ec4a4d5bb546abc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page