This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 1212// Regex code is obtained from SO: https://stackoverflow.com/questions/3143070/javascript-regex-iso-datetime#answer-3143231
1313var ISO_DATE_REGEXP = / \d { 4 } - [ 0 1 ] \d - [ 0 - 3 ] \d T [ 0 - 2 ] \d : [ 0 - 5 ] \d : [ 0 - 5 ] \d \. \d + ( [ + - ] [ 0 - 2 ] \d : [ 0 - 5 ] \d | Z ) / ;
1414// See valid URLs in RFC3987 (http://tools.ietf.org/html/rfc3987)
15- var URL_REGEXP = / ^ [ A - Z a - z ] [ A - Z a - z \d . + - ] * : \/ * (?: \w + (?: : \w + ) ? @ ) ? [ ^ \s / ] + (?: : \d + ) ? (?: \/ [ \w # ! : . ? + = & % @ \- / ] * ) ? $ / ;
15+ var URL_REGEXP = / ^ [ A - Z a - z ] [ A - Z a - z \d . + - ] * : \/ * (?: \w + (?: : \w + ) ? @ ) ? [ ^ \s / ] + (?: : \d + ) ? (?: \/ [ \w # ! : . ? + = & % @ \- / [ \] $ ' ( ) * , ; ~ ] * ) ? $ / ;
1616var EMAIL_REGEXP = / ^ [ a - z 0 - 9 ! # $ % & ' * + \/ = ? ^ _ ` { | } ~ . - ] + @ [ a - z 0 - 9 ] ( [ a - z 0 - 9 - ] * [ a - z 0 - 9 ] ) ? ( \. [ a - z 0 - 9 ] ( [ a - z 0 - 9 - ] * [ a - z 0 - 9 ] ) ? ) * $ / i;
1717var NUMBER_REGEXP = / ^ \s * ( \- | \+ ) ? ( \d + | ( \d * ( \. \d * ) ) ) ( [ e E ] [ + - ] ? \d + ) ? \s * $ / ;
1818var DATE_REGEXP = / ^ ( \d { 4 } ) - ( \d { 2 } ) - ( \d { 2 } ) $ / ;
Original file line number Diff line number Diff line change @@ -2544,11 +2544,13 @@ describe('input', function() {
25442544 expect ( URL_REGEXP . test ( 'mailto:user@example.com?subject=Foo' ) ) . toBe ( true ) ;
25452545 expect ( URL_REGEXP . test ( 'r2-d2.c3-p0://localhost/foo' ) ) . toBe ( true ) ;
25462546 expect ( URL_REGEXP . test ( 'abc:/foo' ) ) . toBe ( true ) ;
2547+ expect ( URL_REGEXP . test ( 'http://example.com/path;path' ) ) . toBe ( true ) ;
2548+ expect ( URL_REGEXP . test ( 'http://example.com/[]$\'()*,~)' ) ) . toBe ( true ) ;
25472549 expect ( URL_REGEXP . test ( 'http:' ) ) . toBe ( false ) ;
25482550 expect ( URL_REGEXP . test ( 'a@B.c' ) ) . toBe ( false ) ;
25492551 expect ( URL_REGEXP . test ( 'a_B.c' ) ) . toBe ( false ) ;
25502552 expect ( URL_REGEXP . test ( '0scheme://example.com' ) ) . toBe ( false ) ;
2551- expect ( URL_REGEXP . test ( 'http://example.com:9999/~~ ``' ) ) . toBe ( false ) ;
2553+ expect ( URL_REGEXP . test ( 'http://example.com:9999/``' ) ) . toBe ( false ) ;
25522554 } ) ;
25532555 } ) ;
25542556 } ) ;
You can’t perform that action at this time.
0 commit comments