That's exactly what I was saying *wouldn't* work. Or rather, that would be overcomplicated.  Just search for open/close bracket pairs--optionally with the first character inside the brackets being `#`, and then search within the matched text for matches to `#(\d+)`.