I am trying to create a regex for addresses.
I currently have
"5432 Lorem St. Tokyo, Japan 1234-54"
"5323 Dolor Ave... Kyoto,,,, Japan 555-33----33"
To disallow a repeated character from the set of "comma", "dot", or "hyphen", you can use a negative lookahead anchored at the start:
(?!.*([.,-])\1) lookahead checks if there is a repeated comma, dot or hyphen (see
([.,-])\1 - a capturing group followed with a backreference) and fails the match if found.
Also, to disallow partial matches, the anchors -
^ for start of string and
$ for the end of string - are necessary.