Here is a regular grammar for quotelink:
number -> [1-9][0-9]*
range -> number "-" number
numberorrange -> number | range
list -> numberorrange ("," numberorrange)*
The resulting regex, with extra parens for pair highlighting:
(([1-9][0-9]*)|(([1-9][0-9]*)-([1-9][0-9]*)))(,(([1-9][0-9]*)|(([1-9][0-9]*)-([1-9][0-9]*))))*
^^ number ^ ^^ number ^ ^ number ^^^ ^^ number ^ ^^ number ^ ^ number ^^^
|+-----------+ |+-----------+ +-----------+|| |+-----------+ |+-----------+ +-----------+||
| | range || | | range ||
| +---------------------------+| | +---------------------------+|
| numberorrange | | numberorrange |
+-------------------------------------------+ +-------------------------------------------+
This can be "simplified" by making the range-closing optional, but such "simplifications" tend to be counterproductive for long-term maintainability. And you should still add strict sanity checks in bbs.scm:posts-range.