Here, if you are familiar with regular expressions
Let's go to the topic. The tool name is regular expression configuration. You can download it from here. The current version is 1.0 Release. Rex, which is a command line tool,
You can run the command in cmd to see the usage. This is. netProgram. We can reference it and use the following code to generate the string array we want.
CopyCode The Code is as follows: // <summary>
/// Generates the test.
/// </Summary>
/// <Remarks> author Petter Liu http://wintersun.cnblogs.com </remarks>
[Test]
Public void generatetest ()
{
String RegEx = @ "^ 1 (3 [4-9] | 5 [1, 012789] | 8 [78]) \ D {8} $ ";
Rexsettings settings = new rexsettings (RegEx) {k = 10, encoding = characterencoding. ASCII };
VaR Results = rexengine. generatemembers (settings );
Foreach (VAR result in results)
{
Console. writeline (result );
}
}
Output:
18897190518
18889349691
18792280668
18831202949
15789824598
15998890392
13709912389
18779992048
13967892889
15928882992
Here we use the regular expression of the mobile phone number. set the number of generations to 10, encoded in ASCII format. there are many options. you can view its members. you can use the string data for your purposes.
Author: Petter Liu