I have a set of entries for matching. One pattern, that I have already written, matches strings that consist of "-" only, e.g.:
----
---
--------
The regex code for matching these is
r"^[-]+$"
Now I need to match strings that contain "-" character, but only if there are other word characters in the string, e.g.:
---vsgvrf-sgwfwrgfs---
-----hwvchwbfk
bfcbewubf------
-efefe-ege-
-gdiwen
Etc. I have tried next patterns, but they do not work and skip some of the string:
r"(\w[^-])+-+(\w[^-])*"
r"\w[^-]+-+\w[^-]+|-+\w[^-]+|\w[^-]+-+"
Could somebody help me here?