A little tool to visualize the difference in Haxe's EReg class.
Download or clone this repo. Using lix run lix download to install missing libs.
Then run haxe build.hxml && haxe collect.hxml. Checkout the generated results.html in the bin directory.
| expected | python/re | php/PCRE | js/RegExp | neko/PCRE | hl/PCRE | |
|---|---|---|---|---|---|---|
| ~/abc$/u.match('abc\r\n') | false | 👍 | 👍 | 👍 | 👍 | 👍 |
| ~/abc$/u.match('abc\r') | false | 👍 | 👍 | 👍 | 👍 | 👍 |
| ~/abc$/u.match('abc\n') | true | 👍 | 👍 | ❌ | 👍 | 👍 |
| ~/abc$/u.match('abc') | true | 👍 | 👍 | 👍 | 👍 | 👍 |
| ~/abc$/mu.match('abc\r\n') | true | ❌ | ❌ | 👍 | ❌ | ❌ |
| ~/abc$/mu.match('abc\r') | false | 👍 | 👍 | ❌abc | 👍 | 👍 |
| ~/abc$/mu.match('abc\n') | true | 👍 | 👍 | 👍 | 👍 | 👍 |
| ~/^abc/u.match('abc') | true | 👍 | 👍 | 👍 | 👍 | 👍 |
| ~/^abc/u.match('\rabc') | false | 👍 | 👍 | 👍 | 👍 | 👍 |
| ~/^abc/u.match('\r\nabc') | false | 👍 | 👍 | 👍 | 👍 | 👍 |
| ~/^abc/u.match('\nabc') | false | 👍 | 👍 | 👍 | 👍 | 👍 |
| ~/^abc/mu.match('\rabc') | false | 👍 | 👍 | ❌abc | 👍 | 👍 |
| ~/^abc/mu.match('\r\nabc') | true | 👍 | 👍 | 👍 | 👍 | 👍 |
| ~/^abc/mu.match('\nabc') | true | 👍 | 👍 | 👍 | 👍 | 👍 |
| ~/^abc$/u.match('foo\r\nabc\r\n') | false | 👍 | 👍 | 👍 | 👍 | 👍 |
| ~/^abc$/u.match('foo\nabc\n') | false | 👍 | 👍 | 👍 | 👍 | 👍 |
| ~/^abc$/mu.match('foo\r\nabc\r\n') | false | 👍 | 👍 | ❌abc | 👍 | 👍 |
| ~/^abc$/mu.match('foo\nabc\n') | true | 👍 | 👍 | 👍 | 👍 | 👍 |
| ~/^abc$/mu.match('\n\rfoo\r\n\rabc\r\n') | false | 👍 | 👍 | ❌abc | 👍 | 👍 |
| new EReg('^\Rabc\R$', 'mu').match('\n\rfoo\r\n\rabc\r\n') | true | ⛔ | 👍 | ⛔ | 👍 | 👍 |
| new EReg('^(\r\n|\n|\r)abc(\r\n|\n|\r)$', 'mu').match('\n\rfoo\r\n\rabc\r\n') | true | 👍 | ⛔ | 👍 | ⛔ | ⛔ |