Function To Create Regex Matching a Number Range
Here’s a quick hack: <?php function regex_range($from, $to) { if($from < 0 || $to < 0) { throw new Exception(“Negative values not supported”); } if($from > $to) { throw new Exception(“Invalid range $from..$to, from > to”); } $ranges = array($from); $increment = 1; $next = $from; $higher = true; while(true) { $next += $increment; if($next … Read more