change regex to avoid matching #X with characters around it