Live data from Hacker News

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

github.com

41–50 of 91 posts

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

#41
post #26

Earlier quoted context omitted.

Learn basic syntax and you'll spend the next few decades wondering each time _which_ basic syntax is expected because none of them ever say.

I know the basic syntax and I never have that problem. Perhaps you mean the advanced syntax? However I don't see the problem, there either. I usually don't need it, and to be honest, when I do, I find it more maintainable to use multiple simpler expressions combined with some programming.

You must not have suffered enough, I mean used regexs widely enough.

He meant “syntax” in the sense that different regex engines have different syntax and capabilities - can I do a negative look ahead assertion in engines Z, how do I do a zero width lookaround in pcre, gnu, python, posix, etc.

Depending how far down the rabbit hole you want to go, start here:

https://swtch.com/~rsc/regexp/regexp1.html

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

#42
post #13

Neat, Though it does make me wonder if a python parser wont soon become standard in editors. Its just too damned convenient for many things, sure you might be able to come up with a regexp search and replace that does the same thing, but odds are it will take longer than coding a few loops. BASH sucked far too much, and C++ and most languages lacked the convenient filesystem libs required, but python just works and i…

How do you sandbox python?

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

#43
post #36
post #16

Earlier quoted context omitted.

It is proven that Turing machines can recognize a wider class of languages than Chomsky regular expressions. However, the article uses something more powerful than Chomsky regular expressions, because they contain backreferences (as \2 and \4), and also there is a repeated search-and-replace involved, which also adds to their power.

Do you mean Chomsky hierarchy by Chomsky regex?

Regular languages are an element included in Chomsky's hierarchy: https://en.wikipedia.org/wiki/Chomsky_hierarchy https://en.wikipedia.org/wiki/Formal_language

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

#45
post #13

Neat, Though it does make me wonder if a python parser wont soon become standard in editors. Its just too damned convenient for many things, sure you might be able to come up with a regexp search and replace that does the same thing, but odds are it will take longer than coding a few loops. BASH sucked far too much, and C++ and most languages lacked the convenient filesystem libs required, but python just works and i…

How about elisp?

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

#47
post #3

Earlier quoted context omitted.

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

I find myself wondering if anyone has done a proper analysis to prove that human activity is Turing complete!

Turing's original idea of a "computer" was a human manipulating symbols on paper, so I would say trivially yes
Post reply on HN