この正規表現を試してください:
^(?:[a-zA-Z]+(?:[.'\-,])?\s?)+$
これは一致します:
コーダレーン
サンタンバレー
セントトーマス
セントトーマス-ヴィンセント
セントトーマスヴィンセント
セントトーマス-ヴィンセント
セント-トーマス
アナコンダ-ディアロッジ郡
モンテセントトーマス
サン。タン。バレー
ワシントンDC
しかし、一致しません:
セントトーマス
セントトーマス--ヴィンセントセント-
トーマス-ヴィンセント
セント--トーマス
San. Tan. Valley
(おそらく2つのピリオドを持つ都市名があるので、一致させました。)
正規表現の仕組み:
# ^ - Match the line start.
# (?: - Start a non-catching group
# [a-zA-Z]+ - That starts with 1 or more letters.
# [.'\-,]? - Followed by one period, apostrophe dash, or comma. (optional)
# \s? - Followed by a space (optional)
# )+ - End of the group, match at least one or more of the previous group.
# $ - Match the end of the line