question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Handle interleaved matchers

See original GitHub issue

I am facing issues when I interleave matchers. For a simple example I got a matcher for markdown like syntax which maps like this:

/\*(.*?)\*/ => <strong>firstCapturingGroup</strong>
/\_(.*?)\_/ => <i>firstCapturingGroup</i>

This works as expected for simple contents like *foo* or _foo_. The result for interleaved content like _*foo*_ is <i>#{{0}}#</i> instead of the intended <i><strong>foo</strong></i>.

I understand why this happens but I couldn’t think of a simple fix/workaround. Is there a recommended way to handle this case?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
milesjcommented, Oct 17, 2019

Got it working. Tagged interweave@12.0.0-alpha.0 if you want to test it. There are examples in that PR.

1reaction
sapkracommented, Oct 17, 2019

Interleaving works perfectly when separating the matchers. Appreciate your work!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Find if a string is interleaved of two other strings | DP-33
Given three strings A, B and C. Write a function that checks whether C is an interleaving of A and B. C is...
Read more >
The ABCs of Interleaved ADCs - Analog Devices
Across many segments of the market today, interleaving analog-to-digital converters (ADCs) offers several advantages in many applications.
Read more >
check if one string is interleaved by two other strings
1 Answer 1 ... You do need the final else if to catch the cases when the next character in C matches the...
Read more >
Excel Factor 14 Interleave Data from Two Columns into One
The catch is we need to interleave the data from one column into the next. ... highlight BOTH formulas and then grab the...
Read more >
[gem5-dev] Change in gem5/gem5[develop]: sim: Handle ...
Change subject: sim: Handle interleaved device memory . ... Therefore, the device memory check would fail if the interleaving masks did not match....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found