In the regularexpr module, we have a function that parse the range of pages. It returns None when the input is invalid.
The input is invalid when the there is any invalid range. An invalid range occurs when the bottom value is greater than the top one.
Valid inputs:
- 1,3,5-10,20,21
- 1,2,4-10,3, 12-15
Invalid inputs:
- 1-5,7,9-11,15-13
- 1-9, 12-10
Display an alert box if the return of the function is None, explaining that the input line was wrong.