0

How can I write a regex that matches the "e" trailings of every word, exept the "e" trailings of words with 2 or 3 letters?

Example:

abcdeeee: Full match for "eeee"

more: Full match for "e"

pie: No match

me: No match

mrzasa
  • 22,895
  • 11
  • 56
  • 94
adsip
  • 13
  • 2

1 Answers1

1

Use a lookaround assertion:

e+(?<=\w{4})\b

This matches e characters if afterwards there have been 4 word characters before the final e. The \b makes sure it ends at a word boundary

Demo

L3viathan
  • 26,748
  • 2
  • 58
  • 81