File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 99 alphanumUnderscoreDash ,
1010 alphanumUnderscoreDollarDash ,
1111 alphanumdash ,
12+ alphanumdashLowercase ,
1213 alphanumdashdots ,
1314 alphanumdashdotsorempty ,
1415 alphanumdashdotsspaces ,
@@ -318,6 +319,7 @@ describe('@regex', () => {
318319
319320 describe ( 'alphanumLowercase' , ( ) => {
320321 test . each ( [
322+ [ alphanumdashText , false ] ,
321323 [ asciiLetters , false ] ,
322324 [ asciiLowercase , true ] ,
323325 [ asciiUppercase , false ] ,
@@ -335,6 +337,26 @@ describe('@regex', () => {
335337 } )
336338 } )
337339
340+ describe ( 'alphanumdashLowercase' , ( ) => {
341+ test . each ( [
342+ [ asciiLetters , false ] ,
343+ [ asciiLowercase , true ] ,
344+ [ alphanumdashText , true ] ,
345+ [ asciiUppercase , false ] ,
346+ [ digitsTest , true ] ,
347+ [ emailTest , false ] ,
348+ [ octdigits , true ] ,
349+ [ hexdigits , false ] ,
350+ [ printable , false ] ,
351+ [ punctuation , false ] ,
352+ [ whitespace , false ] ,
353+ [ cronTest , false ] ,
354+ [ macAddress1 , false ] ,
355+ ] ) ( 'should match regex %s to be %s' , ( string , expected ) => {
356+ expect ( alphanumdashLowercase . test ( string ) ) . toBe ( expected )
357+ } )
358+ } )
359+
338360 describe ( 'alphanumSpacesDotsUnderscoreDash' , ( ) => {
339361 test . each ( [
340362 [ asciiLetters , true ] ,
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ export const alphanumdashorempty = /^$|^[a-zA-Z0-9-]*$/
1010export const alphanumdashspaces = / ^ [ a - z A - Z 0 - 9 - \s] * $ /
1111export const alphanumdots = / ^ [ a - z A - Z 0 - 9 . ] * $ /
1212export const alphanumLowercase = / ^ [ a - z 0 - 9 ] + $ /
13+ export const alphanumdashLowercase = / ^ [ a - z 0 - 9 - ] + $ /
1314export const alphanumSpacesDotsUnderscoreDash = / ^ [ a - z A - Z 0 - 9 -.\s _ ] * $ /
1415export const alphanumUnderscoreDash = / ^ [ a - z A - Z 0 - 9 _ - ] * $ /
1516export const alphanumUnderscoreDollarDash = / ^ [ a - z A - Z 0 - 9 _ $ - ] * $ /
You can’t perform that action at this time.
0 commit comments