Follow @shai_rai
Today I got a interesting questions from a customer – How I can force format to a version field?
I said cool finally I can use the MATCH Element (Work Item Type Definition Schema) to set a regex for System.Title field, The MATCH rule doesn't support full regular expressions, but a simplified version.
<MATCH pattern="pattern to match" for="user name" not="user name" />
Enforces basic pattern matching for strings only. <pattern> should be replaced with the match pattern. Valid values are "A", "N", "X", all other values are taken as literals.
"A" represents an alpha character.
"N" represents a numeric character.
"X" represents either alpha or numeric. This is only supported for string type fields.
Examples:
Enjoy
there's a typo here:
"N" represents either alpha or numeric. This is only supported for string type fields.
should be:
Thanks!
One important note (that makes this feature much more powerful) is that you can have more than one match element. And if any of them are true then the match succeeds.
So:
<MATCH pattern="NN.NN.NN"/>
<MATCH pattern="N.NN.NN"/>
<MATCH pattern="N.N.NN"/>
<MATCH pattern="N.N.N"/>
<MATCH pattern="N.NN.N"/>
<MATCH pattern="NN.NN.N"/>
<MATCH pattern="NN.N.N"/>
<MATCH pattern="NN.N.NN"/>
will support a 3 part version number. (ie: 1.2.3 AND 10.20.30 will both validate ok. But 1a.351.15& will not)
Pingback from X01 Team Foundation Server List