3 ms·
Some people find entertaining from these extremely compact syntax languages. I have hard time to understand them, but such is life.
by hasa 7y ago
Some people find entertaining from these extremely compact syntax languages. I have hard time to understand them, but such is life.
- floatingatoll 7y agoRegular expressions are a more concise way of writing string matching and extraction code, often exponentially more efficiently than without. They’re also usually more compact than spoken English can represent. For example, this proofreading regex detects possible issues in spelling: /(?<!c)i(?=e)/
- tkfu 7y agoThat's a really bad proofreading regex, though, because it will be wrong more than a third of the time--which is much, much higher than the expected real spelling error rate. The "i before e except after c" rule only has a high success rate when you add the caveat that it only applies to words where the ie or ei makes the sound [i:] (like in "believe", for example), and that caveat isn't expressible via regex.
- quelltext 7y agoDoesn't that regex detect correct spellings instead of wrong ones? I.e. it matches tier, tie, etc.
- floatingatoll 7y agoYes. Good eye :) The other comment is also quite accurate: it doesn’t properly grasp phonetics.
- quelltext 7y agoFWIW, I agree with your argument (I guess). Regular expressions are complex and oftentimes a tool might be necessary to get a better idea of what an expression will match. However, if we were to make the language to describe them more verbose that'd still not solve this issue. Having a concise way to describe them is a good thing. Those who grok them can do so quickly without having to read several lines of a more descriptive language and those who need assistance can still plug them into a tool.