Table of Contents

Search

  1. Preface
  2. Introduction to Test Data Management
  3. Test Data Manager
  4. Projects
  5. Policies
  6. Data Discovery
  7. Creating a Data Subset
  8. Performing a Data Masking Operation
  9. Data Masking Techniques and Parameters
  10. Data Generation
  11. Data Generation Techniques and Parameters
  12. Working with Test Data Warehouse
  13. Analyzing Test Data with Data Coverage
  14. Plans and Workflows
  15. Monitor
  16. Reports
  17. ilmcmd
  18. tdwcmd
  19. tdwquery
  20. Data Type Reference
  21. Data Type Reference for Test Data Warehouse
  22. Glossary

String Data Pattern Examples

String Data Pattern Examples

You want to generate email addresses, credit card numbers, phone numbers, Social Insurance numbers, Social Security numbers, dates, IP addresses, and employee IDs from regular expressions.

Email Address

To generate email addresses, you must enter the pattern in the following order:
  1. Enter the first eight characters as lowercase alphabet characters [a-z].
  2. Enter the sign (@).
  3. Enter hotmail, yahoo, gmail, aol, or Comcast.
  4. Enter .com, co.uk, or .net.
To generate an email address, use the following pattern:
[a-z]{8}@(hotmail|yahoo|gmail|aol|Comcast)\.(com|co\.uk|net)
. To generate a data pattern for uppercase and lower alphabet characters, you can enter
([a-z]|[A-Z]){8}@(gmail|hotmail)\\.(com|co\\.uk)
.

Credit Card Number

To generate a credit card number, you enter the first character and the pattern.
The following table shows the output for sample patterns that generate credit card numbers:
Pattern
Sample Output
4\d{3}-\d{4}-\d{4}-\d{4}
4312-0036-5436-0876
3\d{4} \d{4} \d{6}
3852 0000 023237

Phone Number

The following table shows the output for sample patterns that generate phone numbers:
Pattern
Sample Output
\d{3}\.\d{3}\.\d{4}
617.555.1212
\d{3}-\d{3}-\d{4}
617-555-1212
\(\d{3}\) \d{3}-\d{4}
(617) 555-1212
\+\d\.\d{3}\.\d{3}\.\d{4}
+1.617.555.1212
\d\.\d{3}\.\d{3}\.\d{4}
1.617.555.1212

Social Insurance Number

The following table shows the output for sample patterns that generate Social Insurance numbers:
Pattern
Sample Output
\d{3}-\d{3}-\d{3}
289-645-236
\d{3}\.\d{3}\.\d{3}
289.645.236
\d{3} \d{3} \d{3}
289 645 236

Social Security Number

The following table shows the output for a sample pattern that generates a sample Social Security number:
Pattern
Sample Output
\d{3}-\d{2}-\d{4}
999-99-9999

Date

The following table shows the output for sample patterns that generate dates:
Pattern
Sample Output
(1|3|5|7|8|10|12)-([1-9]|[12][0-9]|30|31)-(200[0-9]|201[0-3])
5-30-2013
(4|6|9|11)-([1-9]|[12][0-9]|30)-(200[0-9]|201[0-3])
11-22-2012
(0[1-9]|1[0-2])\/((0[1-9]|2\d)|3[0-1])\/(19\d\d|200[0-3])
12/31/2003

IP Address

The following table shows the output for sample patterns that generate IP addresses:
Pattern
Sample Output
([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])
255.255.0.0
(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])
192.168.0.1

Employee ID

The following table shows the output for sample patterns that generate employee IDs:
Pattern
Sample Output
([A-Z][a-z]{2}_\d+)
Idd_1111
([A-Z][A-Z]-\d\d\d\d)
ID-4321