Ok, up to now everthing works with my RegExp:
^[a-zA-Z]+[- a-zA-Z]?[a-zA-Z]+$
I can enter:
the cat
the-cat
but not:
the cat sat
the-cat-sat
I need to modify the above RegExp so you can have Spaces or "-" WITHIN a sentence BUT not in pairs or more, only by themselves
i.e.
the-cat-sat
the cat sat
NOT:
the--cat-sat
the cat sat
Thanks in advance.
^[a-zA-Z]+[- a-zA-Z]?[a-zA-Z]+$
I can enter:
the cat
the-cat
but not:
the cat sat
the-cat-sat
I need to modify the above RegExp so you can have Spaces or "-" WITHIN a sentence BUT not in pairs or more, only by themselves
i.e.
the-cat-sat
the cat sat
NOT:
the--cat-sat
the cat sat
Thanks in advance.