This question was an epic failure, but here\'s the working solution. It\'s based on Gumbo\'s answer (Gumbo\'s was close to working so I chose it as the accepte
If you simply don't want a dash at the end and beginning, try ^[^-].*?[^-]$
^[^-].*?[^-]$
Edit: Bah, you keep changing it.