Switch the search to Regular Expression (if using Agent Ransack it's in the Options tab) and then try this Containing Text expression:
[0-9]{6}-[0-9]{4}
But, a brief look on the Internet for Danish social security regex will show more specific regular expressions, such as:
[0-9]{2}[0-1][0-9][0-9]{2}-[0-9]{4}