I guess this is the same regular expression as the one above in `lib/cylc/graphing.py`? Maybe worth storing its compiled form in a single place?