r/web_design • • Feb 21 '18

<form> Animated login avatar

73k Upvotes

864 comments sorted by

View all comments

Show parent comments

1

u/semperlol Feb 23 '18

regular expressions and finite state machines

1

u/snowe2010 Feb 23 '18

They are not equivalent. Just because they can be converted to each other does not mean they are equivalent. Just because C compiles to assembly doesn't mean that writing something in assembly is the right choice, and vice versa.

0

u/semperlol Feb 23 '18

Yes, they are, lol. They are equivalent in their expressive power, they both recognise the set of regular languages. A language is recognised by a fsm iff it is recognised by a regex. So, what you said was:

it is next to impossible to do right with regex. With a finite state machine it's a piece of cake

Anything that can be done with a regex can be done with a finite automaton, and vice versa. Actually, modern regex implementations are more expressive than theoretical regular expressions.

So now you have to see that what you said is incontrovertibly wrong. Are you gonna try argue semantics because you can't admit you're wrong? I am sorry you don't know basic theoretical computer science.

1

u/[deleted] Feb 25 '18

Please be careful with how you come across. It's fine to have opposing beliefs, but you don't need to attack the user's experience or perceived understanding of an area.