vendredi 3 mars 2017

Regular expression to exclude number from list

I would like to use regex pattern with form element. In this pattern I would like to put a range of numbers that is not allowed as input.

For instance I would have a list of number {1,4,10} and allowed input is any number except these.

I've managed to create this regex:

[^(1|4|10)]

But that also excludes everything contain 0,1 or 4 such as 10.

Aucun commentaire:

Enregistrer un commentaire