1

I try to parse something like this in regexp (js)

CODE
some stuff which contains
even linebreaks
END

CODE
anothEr block of code
END

I want to get all between CODE and END That works with:

/CODE([^(?!END)]*)END/g

The problem is when there is E, N or D somewhere between CODE and END, that's because the second block won't be matched.

So the negative lookahead checks for E, or N or D and not the word "END". Is there a way for negative lookahead for the whole Word "END" ?

martin

marschro
  • 791
  • 8
  • 23

0 Answers0