How to find only the exact word and not just something that contains the word being serached for in Javascript?

For a quick summary, I am writing up a little program to break down a sheet of raw data into different sections. The way they have it written down is basically:

#-Version
##-Category
###-Sub Category
####-Update`

So how do I break it up to where it only searches for the single # (Version) without triggering any of the other categories?

Thanks

Am able to break it apart into an array just not able to do what I was asking above.