/ ^ # start of line \s* # optional whitespace (?!for all) # NOT "for all" (\w+) # One or more word chars \s* # optional whitespace : # a colon \s* # more optional whitespace (\w+) # another set of one or more word chars \s* # and more optional whitespace (?!<=) # NOT followed by the char sequence '<=' /i