Reputation: 1119
How can i rewrite this regex?
var exp = /(070|071|072|073|074|075|076|077|078|079)\d{7,8}$/;
can i do this;
var exp[] = {070,071,072,073,074,075,076,077,078,079};
Upvotes: 2
Views: 37
Reputation: 48277
The simplest change would be to use:
var exp = /(07\d)\d{7,8}$/;
instead of listing out each of the ten consecutive digits.
Upvotes: 3