Explode note and regex?

I’ve created a Tinderbox note from Readwise that contains chapter-by-chapter excerpts, where each chapter begins with a number and the chapter title in all caps.
I’d like to explode this master note into notes at the chapter title line, e.g. “8 A NEW DEMOGRAPHIC”, using the regex “^\d+.*$”. Though BBEdit tells me this regex works, I’m doing something wrong in Tinderbox because none of the lines are recognized.
Any guidance would be appreciated!

Opus.tbx (348.2 KB)

Just off the top of my head, I’d try looking for paragraphs beginning with a digit

^[0-9]

Does that give you what you’d expect? This sort of simplification is helpful when debugging. Of course, this might general false positives, but it’s a starting point.

1 Like

Just checkin but the ^ is checking the start of $Text rather than the start of the line. You want \d+ (N.B. trailing space) as in:

See result: Opus-ed1.tbx (851.1 KB)

Yes! and thanks for helping me finally understand why “^” can work in something like BBEdit but in Tinderbox it’s actually finding the start of $Text, rather than the start of each line in $Text.

Consider searching for \n\d+ to locate numbers after a carriage return.

1 Like

I think my aTbRef notes are off here. Recently, Tinderbox moved fully off the old BOOST library onto Xcode regex libraries. Perhaps that made a difference in relation to ^ and ~$`. Anyway, I’ll check.

1 Like

My article on Exploding Notes has been clarified with regard to the implication of the ^ and $ regex characters.

3 Likes