79537149

Date: 2025-03-26 20:01:09
Score: 0.5
Natty:
Report link

Oh, my dear. I'm du%& as a post.

The token \s also matches \r and \n and that's why it is stepping over the line break.

Just doing:

  const VALUE_PART = {
    scope: "addition",
    begin: /[:=]/,
    end: /$/, // Match until the end of the line
    excludeBegin: true, // Ensure the separator is not included
    excludeEnd: true,
  }

does the trick. Fiddle is updated.

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Tom