Get hash from string (like a href link attribute)