79612488

Date: 2025-05-08 13:27:59
Score: 1
Natty:
Report link

My proposition expressed as a Java regular expression:

\p{Alpha}+([ ,.'-]\p{Alpha}+)

This is matching text that consists of Unicode words separated by one of given separators. Still not perfect, but it will not accept a sequence of just many dash characters.

Some online tester here: https://www.regexplanet.com/advanced/java/index.html?regex=%5Cp%7BAlpha%7D%2B%28%5B+%2C.%27-%5D%5Cp%7BAlpha%7D%2B%29&replacement=&input=%2C%2C%2C%2C&input=Jan+Nowak&input=Anna+Nowak-Kowalska&input=Anna++Nowak&input=Anna+Nowak-Kowalska-&input=&input=&input=

Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
Posted by: Krzysztof Tomaszewski