How to create a Regular Expression in Data Generator?

Hello everybody,
it's a GREAT feature I can create a random text field using a Regular Expression, but.... HOW can I specify a regular expression?

[159 byte] By [paolod] at [2008-2-13]
# 1
You can select a column in Column Details tool window, choose RegularExpression in Generator column, and invoke properties browser by click view -> properties Window main menu. In properties browser, navigate to Generator section, and there is Expression property, you can specify your regular expression there. After you provided regular expression, you can use Preview tool window to preview the data generation.
LiangxiaoZhu-MSFT at 2007-9-10 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Database Professionals...
# 2

The syntax and operators we support so far is the following:

.

\

()

{n}

{n,m}

{n,}

*

+

?

|

[a-kmoxA-E0-9]

[^aeoui]

Some useful regular expressions are like:

206\-[2-9]{3}\-[0-9]{4}|\(425\)\-[2-9]{3}\-[0-9]{4}|604\-[2-9]{3}\-[0-9]{4}

[a-z]{6}[0-9]{0,5}@(microsoft\.com|hotmail\.com|msn\.com)

[1-6]{1}[0-9]{1,3} (SE|NE|NW|SW){1} [1-2]{1}[0-9]{1,2}th (ST|CT|PL|AVE){1}\, (Redmond\, WA 9805[0-9]{1}|Bellevue\, WA 9800[1-9]{1}|Sammamish\, WA 9807[0-9]{1}|Seattle\, WA 9806[0-9]{1}|Issaquah\, WA 9808[0-9]{1})

DHL|FedEx|UPS

Just copy and paste one of them into Expression property and see the result generated, also make sure the column size is large enough to hold the strings generated otherwise you will get a complaining message.

Hope you will enjoy it.

Thanks!

Henry Zhang

HenryZhang at 2007-9-10 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Database Professionals...

Visual Studio Team System

Site Classified