I want to match any "nonchar + digits" between a SIGNAL
and an END
word.
(?!SIGNAL)\\W+\\d+(?=END)
BUT: the following matches +2
and ++7
:
random+2END+SIGNAL+random++7END
Why is the +2
matched here? I only would want the ++7
here.
My final goal is to replace the match with blanks.
Example: https://regexr.com/4727h
Java code:
Pattern.compile(REGEX).matcher(input).replaceFirst(StringUtils.EMPTY);