From 9d55d2e14f66a78181b9e305dc5dae3427d2a250 Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Fri, 3 Oct 2025 16:21:18 +0200 Subject: [PATCH 1/3] feat --- src/Controllers/DatabaseController.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Controllers/DatabaseController.js b/src/Controllers/DatabaseController.js index 0050216e2c..095c2e83c1 100644 --- a/src/Controllers/DatabaseController.js +++ b/src/Controllers/DatabaseController.js @@ -111,7 +111,7 @@ const validateQuery = ( Object.keys(query).forEach(key => { if (query && query[key] && query[key].$regex) { if (typeof query[key].$options === 'string') { - if (!query[key].$options.match(/^[imxs]+$/)) { + if (!query[key].$options.match(/^[imxsu]+$/)) { throw new Parse.Error( Parse.Error.INVALID_QUERY, `Bad $options value for query: ${query[key].$options}` From 61e31b3cb337c8672c25c84633d7815933790bb9 Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Fri, 3 Oct 2025 16:28:20 +0200 Subject: [PATCH 2/3] test --- spec/ParseQuery.spec.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spec/ParseQuery.spec.js b/spec/ParseQuery.spec.js index 0e4039979a..d880754271 100644 --- a/spec/ParseQuery.spec.js +++ b/spec/ParseQuery.spec.js @@ -2113,6 +2113,19 @@ describe('Parse.Query testing', () => { .then(done); }); + it('regex with unicode option', function (done) { + const thing = new TestObject(); + thing.set('myString', 'hello 世界'); + Parse.Object.saveAll([thing]).then(function () { + const query = new Parse.Query(TestObject); + query.matches('myString', '世界', 'u'); + query.find().then(function (results) { + equal(results.length, 1); + done(); + }); + }); + }); + it_id('823852f6-1de5-45ba-a2b9-ed952fcc6012')(it)('Use a regex that requires all modifiers', function (done) { const thing = new TestObject(); thing.set('myString', 'PArSe\nCom'); From 92311949645bb8b702914723e896f7efb91cb192 Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Fri, 3 Oct 2025 16:29:43 +0200 Subject: [PATCH 3/3] test --- spec/ParseQuery.spec.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/spec/ParseQuery.spec.js b/spec/ParseQuery.spec.js index d880754271..98ef70564f 100644 --- a/spec/ParseQuery.spec.js +++ b/spec/ParseQuery.spec.js @@ -2113,17 +2113,14 @@ describe('Parse.Query testing', () => { .then(done); }); - it('regex with unicode option', function (done) { + it_id('351f57a8-e00a-4da2-887d-6e25c9e359fc')(it)('regex with unicode option', async function () { const thing = new TestObject(); thing.set('myString', 'hello 世界'); - Parse.Object.saveAll([thing]).then(function () { - const query = new Parse.Query(TestObject); - query.matches('myString', '世界', 'u'); - query.find().then(function (results) { - equal(results.length, 1); - done(); - }); - }); + await Parse.Object.saveAll([thing]); + const query = new Parse.Query(TestObject); + query.matches('myString', '世界', 'u'); + const results = await query.find(); + equal(results.length, 1); }); it_id('823852f6-1de5-45ba-a2b9-ed952fcc6012')(it)('Use a regex that requires all modifiers', function (done) {