GithubHelp home page GithubHelp logo

range-to-regex's Introduction

Create a regex that matches an Integer range

This is a PHP implementation of https://github.com/dimka665/range-regex.

It's not yet optimized (regex could be shorter) but it works.

Usage

regex_for_range(12, 34)

generates "1[2-9]|2\d|3[0-4]"

regex_for_range_complete(1368022487, 1368540887)

generates "136802248[7-9]|136802249\d|1368022[5-9]\d{2}|136802[3-9]\d{3}|13680[3-9]\d{4}|1368[1-4]\d{5}|13685[0-3]\d{4}|1368540[0-7]\d{2}|13685408[0-7]\d|136854088[0-7]"

range-to-regex's People

Contributors

geomagilles avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar

Forkers

cyxou

range-to-regex's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.