Strange explosions

I tried to explode a note (test in attached TBX file, v7.5.6).

The following selections are made in the Explode dialog box:

  • Break at delimiter,
  • remove title from text,
  • delete delimiter.

The delimiter is ^\*\*. Note the space at the end. The carrot is not necessary here, but it is useful when I have a note with triple-star sub-bullets under a two-star line.

Within the note are results from two serial attempts. The first attempt generates notes with undesired double-asterisk prefix. The second time is better, but puzzlingly leaves the last note with a double-asterisk prefix. The third time produced the same result as the second.

Does Explode usually require a warm-up run? And, what am I doing wrong with respect to the final item, which insists on keeping its prefix?

strange explosions.tbx (64.2 KB)

I can replicate this. Using the regex delimiter stated, the last exploded note doesn’t have the delimiter string removed. IOW, whether the number of source items is 1 or N, the Nth retains the delimiter.

This has the smell of a regex issue - pinging @eastgate.

Yes – it’s a regex edge case.

The underlying problem is that I had originally imagined that delimiters would mark the end of chunks, where it’s perfectly reasonable to have them mark the beginning, as you have done here. We’re fairly smart about picking that up, but we weren’t being clever about handling the last chunk correctly.