(Mortar)
9/13/2008 7:40:00 PM
Well, "simple" is a relative word :).
Below are some options available. Let me know if you find any issues with
them:
Matches 3 comma delimited number without leading zeros. The value "255,1,06"
will not match because the 6 is preceded by the zero.
(?=^\d+\,\d+\,\d+$)^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\,?){3}$
Matches 3 comma delimited number with leading zeros. The value "255,1,06"
will match:
(?=^\d+\,\d+\,\d+$)^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\,?){3}$
Of course, there is always the boring and simpler way :). Matches 3 comma
delimited number with leading zeros. The value "255,1,06" will match:
^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?),(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?),(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$
Cheers
Rene
"Anonymous" <billg@microsoft.com> wrote in message
news:%23fOYdWYFJHA.3996@TK2MSFTNGP03.phx.gbl...
> Is there a simple regex expression which matches three comma separated
> values? (0-255,0-255,0-255)
>