Skip to content

SimonWaldherr/ranger

Repository files navigation

ranger

Golang RegExp Ranger

ranger.go generates regexp code for numeric ranges and is inspired by dimka665/range-regex

Codacy Badge Build Status Go Report Card codebeat badge BCH compliance GoDoc

what

generates a regular expression that matches any number between two given numbers.

how

first import simonwaldherr.de/go/ranger and then
call ranger.Compile(23,37) and you will get ^(2[3-9]|3[0-7])$.

why

because we can

who

me

is it any good

yes.

is it "Production Ready™"?

maybe. maybe not

is it fast?

no, definitely not!
take a look at the benchmark in ranger_test.go before using it.