Sponsors

Thứ Sáu, 19 tháng 1, 2007

The best solution?

Have you ever wondered what the best solution is? For example, what if somebody asks you 'What is the correct regex pattern that would match to any 3 digits from 0-9 but not match if those three digits are all zeros, e.g. 123 is a match but 000 is not a match?'So what is the best solution? Is it: ([1-9]\d\d|\d[1-9]\d|\d\d[1-9])This still would allow a string like 1234 to be correct.Or this one:^(

Không có nhận xét nào:

Đăng nhận xét