Regex to find words that contains these letters

You may use this regex with 2 negative lookahead assertions:

/\b(?!\w*([sar])\w*\1)(?!(?:\w*t){3})[sart]{3,}\b/

RegEx Demo

RegEx Details:

  • \b: Word boundary assertion
  • (?!\w*([sar])\w*\1): Negative lookahead to assert we don't have more than one instance of [sar] letters
  • (?!(?:\w*t){3}): Negative lookahead to assert we don't have more than 2 t letter
  • [sart]{3,}: Match 3+ characters containing [sart] characters