Home > Software engineering >  Regex for Wordle
Regex for Wordle

Time:01-22

using the online word game Wordle (enter image description here

CodePudding user response:

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

CodePudding user response:

Try

^pr(?!.*[outyase])(?=.*i)[a-z]{3}$

(?!.*[outyase]) means don't match if any of outyase is found ahead in the string.

(?=.*i) means only match if there is an i ahead in the string.

  •  Tags:  
  • Related