1. Fibonacci Regex Perversity

    Repeated Substitutions

    Consider these two regex substitutions:

    s/fi?b/i/
    s/fii(i*)b/f$1bfi$1b/
    

    (For those unfamiliar with Perlish regexes: that first one says “replace the string fb or fib with the string i”. The second one says “replace a string fiiXb with fXbfiXb, where X ...

    read more