1

I need to match a string that includes words in the same order, but not have a specific word.

name_1 = "Alex Smith" name_2 = "Alex John Smith"

I want to be able match Alex Smith, Alex Smith jr, Alex, Smith IIbut not Alex John Smith or Alex John Smith II ...

I'm trying to get to the regex expression that combines ^(?!.*john).*$ and /\bAlex\b.*\bSmith\b/

kairo13
  • 11
  • 1

0 Answers0