@@ -204,7 +204,7 @@ public void testBooleanMock() {
204
204
public void testXegerMock () {
205
205
MockConfig mockConfig = new MockConfig ()
206
206
// 随机段落字符串
207
- .stringRegex ("I'am a nice man\\ .And I'll just scribble the characters, like:[0-9a-zA-Z]{3,5}[0-9a-zA-Z]{10,20} " )
207
+ .stringRegex ("I'am a nice man\\ .And I'll just scribble the characters, like:[a-z]{2}-[0-9]{2}-[abc123]{2}- \\ w{2}- \\ d{2}@ \\ s{1}- \\ S{1} \\ .?-. " )
208
208
// 邮箱
209
209
.subConfig (RegexTestDataBean .class ,"userEmail" )
210
210
.stringRegex ("[a-z0-9]{5,15}\\ @\\ w{3,5}\\ .[a-z]{2,3}" )
@@ -213,16 +213,16 @@ public void testXegerMock() {
213
213
.stringRegex ("[a-zA-Z_]{1}[a-z0-9_]{5,15}" )
214
214
// 年龄
215
215
.subConfig (RegexTestDataBean .class ,"userAge" )
216
- .numberRegex ("[1-9]{1}[0-9] ?" )
216
+ .numberRegex ("[1-9]{1}\\ d ?" )
217
217
// 用户现金
218
218
.subConfig (RegexTestDataBean .class ,"userMoney" )
219
- .numberRegex ("[1-9]{2}\\ .[0-9] ?" )
219
+ .numberRegex ("[1-9]{2}\\ .\\ d ?" )
220
220
// 用户的得分
221
221
.subConfig (RegexTestDataBean .class ,"userScore" )
222
- .numberRegex ("[1-9]{1}[0-9] {1}" )
222
+ .numberRegex ("[1-9]{1}\\ d {1}" )
223
223
// 用户身价
224
224
.subConfig (RegexTestDataBean .class ,"userValue" )
225
- .numberRegex ("[1-9]{1}[0-9] {3,8}" )
225
+ .numberRegex ("[1-9]{1}\\ d {3,8}" )
226
226
.globalConfig ();
227
227
228
228
System .out .println (JSONObject .toJSONString (JMockData .mock (RegexTestDataBean .class ,mockConfig ),true ));
0 commit comments