4 ms·
Right at the beginning, > This calls for regular expressions Why? A regular expression is a whole new program, written in a whole new programming language (on
by HexDecOctBin 6y ago
Right at the beginning,
> This calls for regular expressions
Why? A regular expression is a whole new program, written in a whole new programming language (one used to program finite state machines, instead of Turing ones, but still). Why not just write a simple function to compare string suffix? Is you programming language (C++, in this case) so anaemic that you need a whole different language to do such basic operations?
This is what people who don't like C++ complain about, in addition to the language, the self-indulgent culture around it.
- tialaramex 6y agoThat immediately jumped out at me. They don't need a regular expression here, it's probably an inappropriate fit, or else it's revealing an undisclosed design assumption. It certainly ensures that I don't take their conclusion to be worth much.
- reanimus 6y agoI mean, there's https://en.cppreference.com/w/cpp/string/basic_string/ends_with https://en.cppreference.com/w/cpp/string/basic_string/ends_w... lol