
How to Match “A B C” where A+B=C: The Beast Tamed (2018) - tosh
http://www.drregex.com/2018/09/a-regex-i-submitted-to-reddit-climbed.html?m=1
======
asicsp
Wonder 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-
be...](http://www.drregex.com/2018/11/how-to-match-b-c-where-abc-beast-
reborn.html#more)

[3] [https://regex101.com/r/QsFZ5M/2](https://regex101.com/r/QsFZ5M/2)

~~~
saagarjha
The link works for me.

------
acje
Real example of how comodity enterprise software is configured.

------
pests
"# Carrying. This is where it gets complicated"

Oh, I thought we were past that already...

------
rmtech
This is a crime against sanity

~~~
carapace
This could be the best and the worst thing I've seen all year.

------
wool_gather
What a fascinatingly bizarre little program. It's like some kind of immutable-
data assembly language with tortured syntax. The next level of Brainfuck.

------
ouid
a b c where a+b=c is not a regular language. What exactly is the constraint on
this challenge?

~~~
lifthrasiir
Whatever the PCRE supports. This essentially means that you can have at least
a context-sensitive grammar, which I think a+b=c indeed is.

------
bArray
Should 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
Not 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.

