From e33996f472263f0aad7795766036908be93071cb Mon Sep 17 00:00:00 2001 From: duqingquan Date: Wed, 4 Sep 2024 11:01:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20RegExpExecArray=E5=A3=B0?= =?UTF-8?q?=E6=98=8E=E7=B1=BB=E5=9E=8B=E6=B5=8B=E8=AF=95=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uni_modules/uts-tests/utssdk/RegExp.uts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/uni_modules/uts-tests/utssdk/RegExp.uts b/uni_modules/uts-tests/utssdk/RegExp.uts index f66c10d..2388cbd 100644 --- a/uni_modules/uts-tests/utssdk/RegExp.uts +++ b/uni_modules/uts-tests/utssdk/RegExp.uts @@ -51,6 +51,15 @@ export function testRegExp(): Result { const regex2 = new RegExp('bar'); expect(regex2.ignoreCase).toEqual(false); }) + test("RegExpExecArray", () => { + // #ifdef APP-ANDROID + const regex1 = RegExp('foo*', 'g'); + const str1 = 'table football, foosball'; + let array1:RegExpExecArray = regex1.exec(str1)!; + console.log(array1[0] == 'foo') + expect(array1[0] == 'foo').toEqual(true); + // #endif + }) test("lastIndex", () => { const regex = /ab/g; const str = 'ab ab ab'; -- GitLab