reFind() and reFindNoCase() do not extract regular expression capture groups as subexpressions

Description

There is a behaviour difference between Lucee and Adobe ColdFusion 2016 & 2018, when using reFindNoCase() and reFind() with the returnsubexpressions argument to return capture groups (inside brackets) within the regular expression.

Under CF2016 and CF2018 the returned MATCH array contains only the matched capture group text in positions 2+.

However under Lucee the returned MATCH array contains a complete copy of the original string.

Sample image attached of actual versus expected results.

Lucee Fiddle: https://trycf.com/gist/2c88c7dbf81eb98c8a09205a30cc8997/lucee5?theme=monokai

Adobe CF Fiddle: https://cffiddle.org/app/file?filepath=ca8fe2be-5601-4ab1-9b8a-bc8a44e0a9ef/555ac924-926d-406f-b8b3-fcf4643a0ae9/4384c2c7-04ba-4190-9a48-300f6b706ea3.cfm

 

 

Attachments

1
  • 25 Jun 2019, 05:11 am

Activity

Show:

Pothys - MitrahSoft 18 March 2021 at 12:09

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

Pothys - MitrahSoft 24 December 2020 at 11:41

Could you please check with fixed version and report here back.

Pothys - MitrahSoft 20 October 2020 at 15:44

This issue was fixed in the lucee version 5.3.8.80-SNAPSHOT onwards. And also I added a fixed version.

Pothys - MitrahSoft 26 June 2019 at 16:09

I've added a test case for this ticket & confirmed the issue happened on lucee as per reporter's description in this ticket. The output for ACF & lucee differs. ACF returns two different matches but lucee returns two matches with same data.

Pull Request: https://github.com/lucee/Lucee/pull/702

Fixed

Details

Assignee

Reporter

Labels

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

Fix versions

Affects versions

Priority

Created 25 June 2019 at 05:15
Updated 18 March 2021 at 12:09
Resolved 18 March 2021 at 12:09

Flag notifications