Is there any “forbidden code patterns” example anywhere on the internet ?

Again, a new cool tool by Microsoft that has simply no use, the “forbidden code patterns”, is there any practical sample of how to write a single useful C# “forbidden code pattern”?

I can defiantly tell the tools not to accept any code that has the word “Hello World” in it, but that’s about it, ok, maybe a bit more.

I want any useful example, anything :-)

I want to see the example so I can write my own custom code patterns, I have a long list, and I still can’t implement it.

Maybe the tool is ok, maybe I am missing something or don’t have the experience, who know, let us see a sample, I am sure you tested that tool with something :-)

[1179 byte] By [G.T.] at [2008-2-23]
# 1
Well I have the same problem....
The regular expressions are the same as the ones used in C# for example?

Also is there any program to help in the making of these regular expressions?

Thanks in advance...

AndrePeixoto at 2007-10-9 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server – Power Tools & Add-ons...
# 2
Assuming you're talking about the checkin policy, the text you put in is a regular expression - for each of the pending changes where the path matches, that creates a policy failure.

You can see the original post with the policy @ http://blogs.msdn.com/jmanning/archive/2006/02/02/523125.aspx

An example would be \.sql$ for "ends with .sql" since 1) you need to escape the . in a regular expression so it doesn't mean "one of any character" and 2) $ means end-of-line (end-of-string in this case).

If you want to know about regular expressions, I would recommend:

Tool to use: Regular Expression Workbench @ http://blogs.msdn.com/ericgu/archive/2003/07/07/52362.aspx

Book: Mastering Regular Expressions @
http://www.oreilly.com/catalog/regex/

JamesManning-MSFT at 2007-10-9 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server – Power Tools & Add-ons...
# 3
See my other response - yes, it uses the .NET Regex class, and there are many tools out there to help you create regex strings, EricGu's happens to be one I remember off the top of my head.
JamesManning-MSFT at 2007-10-9 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server – Power Tools & Add-ons...

Visual Studio Team System

Site Classified