[Solved] Regex: find word with extra characters


I’m going to demonstrate required steps to cook a regex for word help but the requirements are not clear, rules are not strict hence some drawbacks are usual.

\bh+[a-z&&[^e]]*e+[a-z&&[^le]]*l+[a-z&&[^ p  l  e ]]*p+\b
           ^             ^^              ^  ^  ^
           |             ||              |  |--|-> [#2]
           |             ||              |-> [#1]
           |             ||-> Previous char(s) [#2]
           |             |-> [#1]
           |-> Next immediate character [#1]
  • [a-z&&[^lep]] means any letter except l, e or p

Regex to copy / paste:

\bh+[a-z&&[^e]]*e+[a-z&&[^le]]*l+[a-z&&[^lep]]*p+\b

Live demo

6

solved Regex: find word with extra characters