I'm using below regex to find occurance of command EXIT SCRIPT except for last line. However it is not wokring
(?i)(EXIT\s+SCRIPT.*$)(\n)
Working:
(?i)(EXIT\s+SCRIPT.*$)
It's working when used without \n . But I want to capture the code smell only if it not in last line of the file.