in reply to RegEx question

It might be simpler two use two regexes:
# if the string is in $_: /nova scotia/ and not /bank/; # else: $str =~ /nova scotia/ and $str !~ /bank/;
And that second option should also work in Java with the appropriate syntax adaptations.