Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Is there a pattern language that would allow for the search in question being done in a single pattern instead of glueing two patterns together with an OR-operator?


It would be fairly straightforward to write a Wordle DSL if you wanted to, which would be much faster than any generic pattern matcher.

That's the risk of an overly complicated language, you can easily wind up slower than a series of regex filters.


I don't see an or operator in the post anywhere, so I'm confused about which search you mean.


They used two separate searches for where the T was. Didn't bother with an OR in code, just listed the results manually.


    (l[iouy][^taer]t[^aers])|(l[iouy][^taer][^aers]t)
Is in effect what the author is doing in regex (and how it is explained).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: