4 ms·
How to Match “A B C” where A+B=C: The Beast Tamed (2018)
- asicsp 7y agoWonder what happened to the regex101 demo link [1], it just redirects to home page [1] https://regex101.com/r/8e2iU1/2 https://regex101.com/r/8e2iU1/2 --- Edit: Found a newer article [2] which does point a working regex101 link [3] [2] http://www.drregex.com/2018/11/how-to-match-b-c-where-abc-beast-reborn.html#more http://www.drregex.com/2018/11/how-to-match-b-c-where-abc-be... [3] https://regex101.com/r/QsFZ5M/2 https://regex101.com/r/QsFZ5M/2
- saagarjha 7y agoThe link works for me.
- acje 7y agoReal example of how comodity enterprise software is configured.
- rmtech 7y agoThis is a crime against sanity
- carapace 7y agoThis could be the best and the worst thing I've seen all year.
- bArray 7y agoShould probably read the articles first... I was really hoping for: a + b = c, where a = b = c I could only find: * a = b = c = 0 * a = b = c = k/inf (where k < inf and k > -inf) Off-topic but are there other solutions? I checked in Wolfram Alpha and nothing...
- jmaa 7y agoNot sure where you get those weird infinity results from, but the "a = b = c = 0" solution is easily show: Note that "a + b = c" implies "b = c - a", and given our assumption that "a = b = c", we can rewrite as "a = a - a = 0". This obviously results in "a = b = c = 0". EDIT: Modifying the proof above, it becomes apparent that this is a property of groups (most number systems are groups): Again "a + b = c", iff "a + a = a" iff "a + a + (-a) = a + (-a)" which is "a = e". Note that addition over IEEE754 floats do not constitute a group, (in part) because "inf + inf == inf" evaluates to true.
- pests 7y ago"# Carrying. This is where it gets complicated" Oh, I thought we were past that already...
- deleted 7y ago[deleted]
- ouid 7y agoa b c where a+b=c is not a regular language. What exactly is the constraint on this challenge?
- lifthrasiir 7y agoWhatever the PCRE supports. This essentially means that you can have at least a context-sensitive grammar, which I think a+b=c indeed is.
- wool_gather 7y agoWhat a fascinatingly bizarre little program. It's like some kind of immutable-data assembly language with tortured syntax. The next level of Brainfuck.