matthiasgoergens/Div7
View on GitHub ↗ ★ 6 Haskell
Finding regular expressions to test for divisibility of numbers
8 mentions on Hacker News by 1 person: 1 story, 7 comments · first 2010-11-02 · latest 2024-12-03
20082026
-
https://github.com/matthiasgoergens/Div7 is a simple one that you might like.
comment by eru · 2024-12-03 · in 8 months of OCaml after 8 years of Haskell in production (2023) -
…I asked for a something that checks decimal numbers. A real solution looks uglier: check out https://github.com/matthiasgoergens/Div7 , it starts ((((((6(2|9) 8|6(2|9) 1|5)(5(2|9) 8|5(2|9) 1|4) (5(2|9) 7 [...] (Unless you can convert from…
comment by eru · 2015-09-28 · in The Greatest Regex Trick Ever (2014) -
For your entertainment, https://github.com/matthiasgoergens/Div7 has a regex finder for divisibility. E.g. https://raw.github.com/matthiasgoergens/Div7/master/regex7 checks decimal numbers for divisibility by 7.
comment by eru · 2013-08-13 · in frak: Transform collections of strings into regular expressions -
You can find my Haskell version under https://github.com/matthiasgoergens/Div7/
comment by eru · 2011-04-05 · in The Prime That Wasn’t -
To see some genuine regular expression trickery, see https://github.com/matthiasgoergens/Div7/blob/master/regex7 for a regular expression that recognizes decimal numbers that are divisible by 7. If you memorize that expression, you have a…
comment by eru · 2011-04-05 · in The Prime That Wasn’t -
Compatible with grep -Ex See also http://github.com/matthiasgoergens/Div7 for the program that created it.
comment by eru · 2010-11-03 · in Much smaller regular expression to test divisibility by 7 -
▲ 1
Much smaller regular expression to test divisibility by 7story by eru · 2010-11-03 · 4 comments
-
I removed most of the unnecessary parenthesis, now. I also put my program on http://github.com/matthiasgoergens/Div7 I targeted grep, because I know that grep handles regular expressions properly. Perl does a very bad job, according to…
comment by eru · 2010-11-02 · in A regular expression to test for divisibility by 7