Live data from Hacker News

A functioning Turing Machine using Notepad++ and its find/replace regex engine

github.com

1–10 of 91 posts

Re: A functioning Turing Machine using Notepad++ and its find/replace regex engine

#3

I was under the impression that RegEx was not turing complete. Is there something special about N++’s regex engine that allows this?

No, nothing special about N++ (well, lookahead, but many regex engines have that). Repeated Search+Replace is the key, and not part of regex.

Re: A functioning Turing Machine using Notepad++ and its find/replace regex engine

#4
post #3

I was under the impression that RegEx was not turing complete. Is there something special about N++’s regex engine that allows this?

No, nothing special about N++ (well, lookahead, but many regex engines have that). Repeated Search+Replace is the key, and not part of regex.

Aaah of course, thanks

Re: A functioning Turing Machine using Notepad++ and its find/replace regex engine

#7
Cool demonstration of regular expression power! Note that as implemented, this is a space bounded Turing Machine with a hardcoded tape length limit:

> With the current implementation, the read/write head looks at the 22nd element of the tape whenever we want to read the current position. With complicated machines that utilize long lengths of the tape, you would need to increase this number so that you never delete a necessary tape element as you scroll along it. This can be done by increasing the {20} that appears at the beginning of the expression.

Embedding the tape head pointer ^ within the tape, just to the left of the scanned bit, should remove this restriction.

Re: A functioning Turing Machine using Notepad++ and its find/replace regex engine

#10
post #9

Not a Turing machine if the user has to press a button for each step.

That's not relevant as to whether it's a turing machine or not, tho...

The possible calculations (and genericity) is what matters. The "button for each step" could be analogous to powering the turing machine, or turning some crank for Babbage's machine, or whatever..

Post reply on HN