-2
We've all been burned by the grammar police on the internet. What we need is a regex that can be used in place of "there", "their", and "they're". This would shift burden of grammar parsing from the writer to the reader (a sort of "client-side" grammar, if we you will). So, here's what I have to start with:
the([re]|[ir]|[y're]).
...but I'm positive there's room for optimization.
What's the shortest regex that could be used in place of any variation or the aforementioned homohpones?
7Your regex isn't correct. It matches
ther
,thee
,thei
,they
andthe'
. Can't dig up a link right now, but look up "character classes". (Followed by any character if the.
is supposed to be part of the regex, but that seems like a formatting mistake.) – Martin Ender – 2016-10-20T17:33:51.217Bit off-topic with no objective winning criterion, but could actually be a cool challenge. – Magic Octopus Urn – 2016-10-20T17:36:26.540
@carusocomputing I believe it's a golfing tips question which is definitely on topic.
– Martin Ender – 2016-10-20T17:36:49.4801Knot ay gud eye deal too mi. Gust rite it rite. – Geobits – 2016-10-20T17:46:17.290
As worded the correct answer to the question is
.*
, but I'm sure that's not what you intended to ask. Also, spelling is not grammar. You should be complaining about the orthography police, not the grammar police. – Peter Taylor – 2016-10-20T20:59:17.273