REFind() with sub expressions returns incorrect match elements

Description

When I run REFind() with sub expressions all elements in .match are the same.

result = reFind("oo([0-9]+)", "foo42", 1, true);

returns

{ "len": [ 4, 2 ], "match": [ "oo42", "oo42" ], "pos": [ 2, 4 ] }

instead of

{ "len": [ 4, 2 ], "match": [ "oo42", "42" ], "pos": [ 2, 4 ] }

In ACF 2018 this seems to be returned correctly.

Environment

Java 1.8.0_191 (Oracle Corporation) 64bit

Activity

Show:

Pothys - MitrahSoft 18 March 2021 at 12:09

This issue was solved in fixed version so I marked as resolved

Pothys - MitrahSoft 11 December 2020 at 15:13

This issue was solved in fixed version. Could you please check with the fixed version?

Pothys - MitrahSoft 21 October 2020 at 15:31

This issue was fixed in lucee version 5.3.8.82-SNAPSHOT. And added a fixed version.

Pothys - MitrahSoft 14 February 2019 at 16:12

I've added a test case for this ticket & also confirmed the issue happened on lucee. Both Lucee & ACF returns the correct position and length of the string based upon the regex. Only matches are not properly returned by lucee.

Pull request: https://github.com/lucee/Lucee/pull/635

Fixed

Details

Assignee

Reporter

Priority

Labels

Fix versions

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Affects versions

Created 12 February 2019 at 17:52
Updated 18 March 2021 at 12:10
Resolved 18 March 2021 at 12:10

Flag notifications