0

I'm trying to write a regex that filters out matches if they contain "plex" in them.

  • plex-release -> should not match
  • my-release -> should match
  • potato -> should match

Been playing with pythex and came up with this one that works partially:

(?![plex])(\w+)[-_](release|version)$

However this also messes with any other values containing the letter "p". I'm trying to come up with a regex that leaves out matches that only contain the string "plex" and in this order, not just any letter from the string.

Greg
  • 37
  • 3

1 Answers1

0

Yes, you can do it using this regex.

^((?!plex).)*$

Source : Regular expression to match a line that doesn't contain a word

Florian Bernard
  • 2,399
  • 1
  • 7
  • 21