Regex for Wordle
You may use this regex with a positive and negative lookahead conditions:
^pr(?=[a-z]*i)(?![a-z]*[outyase])[a-z]{3}$
Regex Explanation:
-
^
: Start -
pr
: Matchpr
-
(?=[a-z]*i)
: Positive lookahead to make sure we have ani
ahead after 0 or more letters -
(?![a-z]*[outyase]))
: Negative lookahead to disallow any of the[outyase]
characters -
[a-z]{3}
: Match 3 letters
Demo Screenshot:
Trivially, you can use:
^pr([^outyase][^outyase]i|[^outyase]i[^outyase]|i[^outyase][^outyase])$
Also, according to your site, there's actually four words matching, not just two:
- prick
- primi
- primp
- prink