Multiline starts-with

Is it possible to write a multi-line regular expression for the starts-with scope element?

E.g., in Haskell there’s no keyword used in function declaration, so I’m just searching forward for an =, which may occur multiple lines below the start of the function definition (where the function name is often found).

Yes, but only as a lookahead (hint: use \R for line break matching). Defining capture groups for the purpose of highlighting in the lookahead works, too. However, you need to be aware your match will not consume the lookahead part of your start scope, which in turn means your subscopes will start matching earlier than you might expect them to.

1 Like