I have the following simple regex:
/^[a-zA-Z\u00c4\u00e4\u00d6\u00f6\u00dc\u00fc\u00df]+$/
i would like to make it possible to have strings like "Blabla Bla bshfkhsf". But the whole string should not have more then 2 spaces or hyphens.
I know, that i can limit spaces with "\s{0,2}", but how do i place such limit in the regex, so that strings like above are possible and the limit applies to the whole string, not to a "single" character?
EDIT: May this be ok:
^[a-zA-Z\u00c4\u00e4\u00d6\u00f6\u00dc\u00fc\u00df]+((\s)|(-))?[a-zA-Z\u00c4\u00e4\u00d6\u00f6\u00dc\u00fc\u00df]+((\s)|(-))?[a-zA-Z\u00c4\u00e4\u00d6\u00f6\u00dc\u00fc\u00df]+$
Is there any better way?