diff --git a/src/wireviz/wv_helper.py b/src/wireviz/wv_helper.py index 49ba8fe..270afad 100644 --- a/src/wireviz/wv_helper.py +++ b/src/wireviz/wv_helper.py @@ -108,14 +108,16 @@ def open_file_append(filename): def isarrow(inp): """ - Matches strings of one or multiple `-` or `=` (TODO: but not mixed) + Matches strings of one or multiple `-` or `=` (but not mixed) optionally starting with `<` and/or ending with `>`. Examples: <-, --, ->, <-> <==, ==, ==>, <=> + + regex by @shiraneyo """ - return bool(re.match(r"^?$", inp)) + return bool(re.match(r"^\s*(?P-+|=+)(?P>?)\s*$", inp)) def aspect_ratio(image_src): try: