in reply to RegEx question

What comes to mind is a few separate if-statements. First, gnore the line if it does not contain nova scotia. (Least probable so listed first.) Then, perhaps you can simply ignore the line if it does contain bank anywhere. Alternatively, you can split() the line on /nova scotia/ and verify that none of the pieces contains bank.

I have come to dislike fancy-regexes because soon enough some new requirement comes along that messes them up, leaving the poor programmer to make a now-complicated change, and to somehow verify, not only that it handles the new requirement, but also that it continues to handle the old one(s).

Replies are listed 'Best First'.
Re^2: RegEx question
by Your Mother (Archbishop) on Dec 26, 2017 at 16:26 UTC

    Five days after good real answers, this code-free, poor advice written without reading the thread arrives. One should never make the least likely operation the one always run. The regex is meant to be used in two languages so a coded logic tree isn't desired. Options exist in the construction of code between 2x4s and the JPL.