[TxMt] Re: Regex For Markdown Lists Help

Allan Odgaard mailinglist at textmate.org
Mon Feb 9 08:41:02 UTC 2015


On 9 Feb 2015, at 3:41, Bob Rockefeller wrote:

> The regex that isn’t working looks like this:
>
> {    name = 'text.html.markdown.list';
>   match = '(?<=\n)-(?= )|(?<!.)-(?= )';
> },
>
> What did I get wrong?

Use ^ instead of (?<=\n). The grammars only get a single line of 
context, so it can’t look at the line above.

If you need to avoid first line of the document (which your look-behind 
would do) then you can use: ^(?!\A).


More information about the textmate mailing list