Hacker GitHub

← All repos

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

Mentions per year 8 mentions · busiest year 2010 (3)
20082026
  1. https://github.com/matthiasgoergens/Div7 is a simple one that you might like.
  2. …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…
  3. 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.
  4. You can find my Haskell version under https://github.com/matthiasgoergens/Div7/
    comment by eru · 2011-04-05 · in The Prime That Wasn’t
  5. 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
  6. Compatible with grep -Ex See also http://github.com/matthiasgoergens/Div7 for the program that created it.
  7. ▲ 1
    Much smaller regular expression to test divisibility by 7
    story by eru · 2010-11-03 · 4 comments
  8. 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…