I am trying to find a Ruby Regex that will match the following line:
MAINT: Refactor something
STRY-1: Add something
STRY-2: Update something
But it should not match the following:
MAINT: Refactored something
STRY-1: Added something
STRY-2: Updated something
MAINT: Refactoring something
STRY-3: Adding something
STRY-4: Updating something
Basically, the first word after :
should not end either ed
, oring
This is what I have:
^(MAINT|(STRY|PRB)-\d+):\s([A-Z][a-z]+)\s([a-zA-Z0-9._\-].*)
I tried [^ed]
and [^ing]
, but they won’t work here, as I am targeting more than one character.
I cannot find a suitable solution to achieve this.
source
share