Re:Show HN: Search code in GitHub repos using regular expres...
by glangdale on Monday February 24, 2020 @06:36AM
(#22403228)
pattern is, btw: (teakettle\w|abcd)
Either pattern in alternation works fine, but even a simple alternation of the two goes back to the behavior that you might expect to get from awful patterns like \d..\d..\w...\s...\d (i.e. reporting only a partial set of matches).
Re:Show HN: Search code in GitHub repos using regular expres...
by michaelmior on Monday February 24, 2020 @08:12AM
(#22403687)
Did you mean either patter in "isolation"?
This project looks like it pulls literal factors out of the regex that I type in, maybe to an index a la that Russ Cox blog post a while back about Code Search. It seems to Not Like things that have very open-ended character classes (e.g. \w) unless there is a decent length literal involved somewhere.
It seems to have a very rudimentary literal extraction routine, as it decides to give a partial result set when fed an alternation between two literals that it handles pretty well on their own.