4 ms·
Yes, I don't understand the suggestion for regexes as the correct and optimal way to detect palindromes. I hope this is not the expectation in general.
by parennoob 10y ago
Yes, I don't understand the suggestion for regexes as the correct and optimal way to detect palindromes. I hope this is not the expectation in general.
- verroq 10y agoIt is pretty ironic that palindromes cannot be recognised by regular languages.
- pmiller2 10y agoHah, yes. That's probably the simplest application of the pumping lemma I can think of.
- iSnow 10y ago> I don't understand the suggestion for regexes as the correct and optimal way to detect palindromes That made me pause as well, but he actually doesn't say that. He says a "many will use RegEx as a part of the solution" - typically to strip whitespace and punctuation signs - something like /\W/.