Try wrapping the regular expression in a CDATA, like so:
<string><![CDATA[(?x)
('[^\s\[\]]*)
]]></string>
On Tuesday, August 24, 2021 at 11:35:33 AM UTC+2 Daniel Paz wrote:
> btw, if I add
>
> <key>String Pattern</key>
> <string>(?x:
> ('[^\s\[\]]*)
> )
> </string>
>
> it doesn't work anymore.
>
> On Tuesday, 24 August 2021 at 12:18:06 UTC+3 Daniel Paz wrote:
>
>> thanks it worked! btw how can i create new colors? for example if i go to
>> prefrences -> text colors I can see colors of "CSS", "HTML" and more... how
>> can I create one as well? or define fixed colors in my plist?
>>
>> On Tuesday, 24 August 2021 at 11:15:54 UTC+3 jj wrote:
>>
>>> Hi Daniel,
>>>
>>> Here is a minimal Codeless Language Module for an hypothetical "Daniel"
>>> language that accepts hyphens in keywords.
>>> Save it as Daniel.plist in ~/Library/Application Support/BBEdit/Language
>>> Modules.
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "
>>> http://www.apple.com/DTDs/PropertyList-1.0.dtd">
>>> <plist version="1.0">
>>> <dict>
>>> <key>BBEditDocumentType</key>
>>> <string>CodelessLanguageModule</string>
>>> <key>BBLMColorsSyntax</key>
>>> <true/>
>>> <key>BBLMIsCaseSensitive</key>
>>> <false/>
>>> <key>BBLMLanguageCode</key>
>>> <string>Dani</string>
>>> <key>BBLMLanguageDisplayName</key>
>>> <string>Daniel</string>
>>> <key>BBLMSuffixMap</key>
>>> <array>
>>> <dict>
>>> <key>BBLMLanguageSuffix</key>
>>> <string>.daniel</string>
>>> </dict>
>>> </array>
>>> <key>BBLMKeywordList</key>
>>> <array>
>>> <string>step-by-step</string>
>>> <string>Juan-les-Pins</string>
>>> <string>2021-08-24</string>
>>> </array>
>>> <key>Language Features</key>
>>> <dict>
>>> <key>Identifier and Keyword Character Class</key>
>>> <string>\p{L}\p{N}\-</string>
>>> </dict>
>>> </dict>
>>> </plist>
>>>
>>> It currently only support 3 keywords:
>>> • step-by-step
>>> • Juan-les-Pins
>>> • 2021-08-24
>>>
>>> HTH
>>>
>>> Jean Jourdain
>>> On Tuesday, August 24, 2021 at 9:06:14 AM UTC+2 Daniel Paz wrote:
>>>
>>>> It doesn't work if it includes "-" and numbers, for example "Hello-5"
>>>> even if I write:
>>>>
>>>> <key>Identifier and Keyword Character Class</key>
>>>> <string>A-Za-z0-9-</string>
>>>>
>>>> On Sunday, 22 August 2021 at 08:03:20 UTC+3 Christopher Waterman wrote:
>>>>
>>>>> Daniel,
>>>>> Did you add “-“ to Identifier and Keyword Character Class?
>>>>>
>>>>> <key>Identifier and Keyword Character Class</key>
>>>>> <string>A-Za-z-</string>
>>>>>
>>>>> —Chris
>>>>>
>>>>> On Aug 21, 2021, at 1:00 PM, Daniel Paz <[email protected]> wrote:
>>>>>
>>>>> So I want for example to keyword with the following regex:
>>>>> "keyword-keyword" e.g. "Hello-World", but apparently, the char "-" is not
>>>>> allowed to be used as keyword.
>>>>>
>>>>> I also tried the follkowing:
>>>>>
>>>>> <key>BBLMKeywordPatterns</key>
>>>>> <array>
>>>>> <dict>
>>>>> <key>RunKind</key>
>>>>> <string>com.barebones.bblm.variable</string>
>>>>> <key>Pattern</key>
>>>>> <string>[a-zA-Z0-9]+\-[a-zA-Z0-9]+</string>
>>>>> </dict>
>>>>> </array>
>>>>>
>>>>> but it does not work
>>>>>
>>>>> any solution?
>>>>>
>>>>> --
>>>>> This is the BBEdit Talk public discussion group. If you have a feature
>>>>> request or need technical support, please email "[email protected]"
>>>>> rather than posting here. Follow @bbedit on Twitter: <
>>>>> https://twitter.com/bbedit>
>>>>> ---
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "BBEdit Talk" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to [email protected].
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/bbedit/998c9228-fde4-44cc-8457-77b8656b275cn%40googlegroups.com
>>>>>
>>>>> <https://groups.google.com/d/msgid/bbedit/998c9228-fde4-44cc-8457-77b8656b275cn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>>>
>>>>>
--
This is the BBEdit Talk public discussion group. If you have a feature request
or need technical support, please email "[email protected]" rather than
posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/bbedit/9a366c93-f430-4609-9f19-675b36496e41n%40googlegroups.com.