Hi,
I'm having a go a writing a syntax highlighting format for markdown (http://daringfireball.net/projects/markdown/), and I've run into a couple of problems. The first is the lack negative look behind assertions which makes matching escaped sequences (eg. * * *) a lot more complicated. I can use begin, end and swallow, but there isn't any way to limit these to single line sequences. Are there any plans for including them in the future?
The second problem, which I haven't been able to overcome, is matching multiline sequences that end with (eg.) two newlines. For example: begin = "\*"; end = "\n{2,}" doesn't match what I'd expect. Is this a known problem?
Thanks,
Hadley
On 8. Nov 2004, at 3:04, hadley wickham wrote:
[...] I can use begin, end and swallow, but there isn't any way to limit these to single line sequences.
Sort of there is, you can put the end pattern in a positive look-ahead assertion in the begin pattern.
Are there any plans for including them in the future?
Yes.
The second problem, which I haven't been able to overcome, is matching multiline sequences that end with (eg.) two newlines. For example: begin = "\*"; end = "\n{2,}" doesn't match what I'd expect. Is this a known problem?
Known in the sense that patterns are only matched against a single line at a time.
I haven't thought it through, but I think I will be able to remove this limitation in the future.