File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/Adapters/Storage/Postgres Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import Parse from 'parse/node';
5
5
// @flow -disable-next
6
6
import _ from 'lodash' ;
7
7
import sql from './sql' ;
8
+ import { XRegExp } = from 'xregexp' ;
8
9
9
10
const PostgresRelationDoesNotExistError = '42P01' ;
10
11
const PostgresDuplicateRelationError = '42P07' ;
@@ -2438,15 +2439,16 @@ function createLiteralRegex(remaining) {
2438
2439
return remaining
2439
2440
. split ( '' )
2440
2441
. map ( c => {
2441
- if ( c . match ( / [ 0 - 9 a - z A - Z ] / ) !== null ) {
2442
+ const regex = XRegExp ( '[0-9 ]|\\p{L}' ) ; // Support all unicode letter chars
2443
+ if ( c . match ( regex ) !== null ) {
2442
2444
// don't escape alphanumeric characters
2443
2445
return c ;
2444
2446
}
2445
2447
// escape everything else (single quotes with single quotes, everything else with a backslash)
2446
2448
return c === `'` ? `''` : `\\${ c } ` ;
2447
2449
} )
2448
2450
. join ( '' ) ;
2449
- }
2451
+ }
2450
2452
2451
2453
function literalizeRegexPart ( s : string ) {
2452
2454
const matcher1 = / \\ Q ( (? ! \\ E ) .* ) \\ E $ / ;
You can’t perform that action at this time.
0 commit comments