How to write a regular expression that matches 1-8, 11-42, 45-68?

how to write

regular expressions that match 1-8, 11-42, 45-68.
May.13,2022

Don't use regularization. It's a bit of a hassle. What I just wrote is not correct

let num = 9
    if ( (num >=1 && num <= 8) || ( num >= 11 && num <= 42 ) || ( num >= 45 && num <= 68 )) {
        console.log(1)
    }else {
        console.log(2)
    }
Menu