Postgres: Regex support foreign characters (#5598)

* Fix issue #5293

* Fix issue #5293

* add test

* Revert "add test"

This reverts commit 38b32a627a9d2c9a9b852b48194f173d8b7254f3.

* fix conflicts

* use native package
This commit is contained in:
Jeff Gu Kang
2019-06-25 06:13:34 +09:00
committed by Diamond Lewis
parent b178d5ca6a
commit ad7fc48c97
3 changed files with 577 additions and 1072 deletions

View File

@@ -2441,7 +2441,8 @@ function createLiteralRegex(remaining) {
return remaining
.split('')
.map(c => {
if (c.match(/[0-9a-zA-Z]/) !== null) {
const regex = RegExp('[0-9 ]|\\p{L}', 'u'); // Support all unicode letter chars
if (c.match(regex) !== null) {
// don't escape alphanumeric characters
return c;
}