Hi Tim,
As far as I understand it,
BBLMKeywordPatterns are matched against individual words composed of characters in the
<Identifier and Keyword Character Class> or
<Identifier and Keyword Characters>.
As a consequence the ^ anchor in a BBLMKeywordPatterns is sort of equivalent to \b and will always match at the start of a word.
Start of line for an individual word doesn't make much sense.
(Please Rich or Patrick, correct me if I am wrong)
You could kind of achieve what you are looking for by including the '%' and ':' characters in the <Identifier and Keyword Character Class> and matching in the BBLMKeywordPatterns with:
keyword:
and
%keywordtwo:
Watch out though that those sequences might be present in some other unwanted positions in the text, for example at the end of a line before a bullet list.
Another solution could be to use the <Keyword Pattern> which is matched against the text of the document and thus can detect ^ anchors at the start of lines.
...
<key>Language Features</key>
<dict>
...
<key>Keyword Pattern</key>
<string><![CDATA[(?x)
(
^keyword(?=:)
|
^%keywordtwo(?=:)
)
]]></string>
...
<dict/>
...
HTH
Jean Jourdain