Not sure if I tried \b only at the end, but it didn't work for me when I tested both ends (probably because ID doesn't consider # to be a word character), so I switched to (?+\s) on the theory that it would equally define the end of a string. The only place it might fail that I can think of would the the end of a story (just as the lookbehind fails at the beginning).
Basically, I think without seeing exactly how the text is formatted in the document it's going to be pretty difficult to write an expression that is perfect.