[libc++][regex] Throw exception in the case of wrong range (#148231)
Starting and ending parameters are considered to decide that a range is
a correct one
Fix #51028
Co-authored-by: alexey.lazarev <alexey.lazarev@tasking.com>
Co-authored-by: Louis Dionne <ldionne.2@gmail.com>