There is a string which can have one or several string ranges. These are correct strings:
\"\"
\"asd-asd\"
\"asd-asd;asd-asd\"
\"asd-asd;asd-asd;\"
\"asd-asd;asd
You need to make your regex a little more complicated:
^([^;-]+-[^;-]+(;[^;-]+-[^;-]+)*)?$
Explanation:
^ # Start of the string
( # Start of first group:
[^;-]+-[^;-]+ # Match one "asd-asd"
( # Start of second group
; # Match ;
[^;-]+-[^;-]+ # Match another "asd-asd"
)* # Repeat the second group any number of times (including zero)
)? # Make the entire first group optional
$ # End of string