| OLD | NEW |
| (Empty) |
| 1 This page tests invalid character ranges in character classes. | |
| 2 | |
| 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". | |
| 4 | |
| 5 | |
| 6 PASS /[a-c]+/.exec("-acbd"); is ["acb"] | |
| 7 PASS /[a\-c]+/.exec("-acbd") is ["-ac"] | |
| 8 PASS /[c-a]+/.exec("-acbd"); threw exception SyntaxError: Invalid regular expres
sion: /[c-a]+/: Range out of order in character class. | |
| 9 PASS /[\d-x]+/.exec("1-3xy"); is ["1-3x"] | |
| 10 PASS /[x-\d]+/.exec("1-3xy"); is ["1-3x"] | |
| 11 PASS /[\d-\d]+/.exec("1-3xy"); is ["1-3"] | |
| 12 PASS /[\d-a-z]+/.exec("az1-3y"); is ["az1-3"] | |
| 13 PASS /[\d\-x]+/.exec("1-3xy"); is ["1-3x"] | |
| 14 PASS /[x\-\d]+/.exec("1-3xy"); is ["1-3x"] | |
| 15 PASS /[\d\-\d]+/.exec("1-3xy"); is ["1-3"] | |
| 16 PASS /[\d-]+/.exec("1-3xy") is ["1-3"] | |
| 17 PASS successfullyParsed is true | |
| 18 | |
| 19 TEST COMPLETE | |
| 20 | |
| OLD | NEW |