Allow multi-line lookahead in modes
See original GitHub issueSince patch 846d043e9fd88afd98f8615b5df117de72242206 , the considerations that made lookahead past the current line problematic have largely been made irrelevant.
See discussion here
A mode would still have to declare its maxmimum lookahead, so that the parser frontier can be backed up appropriately when the document is edited. And it does muddle up the StringStream API a bit more (i.e. the various pieces of code that run parsers, such as runMode
, need to somehow expose the whole document to the stream), but it’s probably worth it.
Issue Analytics
- State:
- Created 11 years ago
- Reactions:3
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Regex Match multiple lines in between positive lookbehind ...
Regex Match multiple lines in between positive lookbehind and positive lookahead · Just strip the newlines from your match, what is the problem?...
Read more >Multiline mode of anchors ^ $, flag "m"
The multiline mode is enabled by the flag m . It only affects the behavior of ^ and $ .
Read more >Lookahead and Lookbehind Tutorial—Tips &Tricks - RexEgg
This allows us to remove one lookahead and to simplify the pattern to ... For instance, by matching (?m)^ (the beginning of a...
Read more >Regex Tutorial - Turning Modes On and Off for Only Part of ...
Normally, matching modes are specified outside the regular expression. In a programming language, you pass them as a flag to the regex constructor...
Read more >Options for regular expression | Microsoft Learn
Learn how to use regular expression options in .NET, such as case-insensitive matching, multiline mode, and right-to-left mode.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This was finally implemented in 5.27.0 (via the
StringStream.lookahead
method)Also interested in limited look-ahead, particularly for Fountain.io markup. I’ve been able to mostly implement highlighting by updating state with blank lines, but I think the canonical syntax definitions rely on look-ahead.