Open Bug 1362154 Opened 3 years ago Updated 28 days ago

Implement RegExp named groups

Categories

(Core :: JavaScript Engine, enhancement, P2)

enhancement

Tracking

()

Webcompat Priority ?
Tracking Status
firefox60 --- fix-optional

People

(Reporter: leonardo.balter, Unassigned)

References

(Depends on 1 open bug, Blocks 2 open bugs)

Details

(Keywords: dev-doc-needed, parity-chrome, parity-safari)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36

Steps to reproduce:

The TC39's proposal is currently on stage 3:

https://github.com/tc39/proposal-regexp-named-groups

Test262 files are using the `regexp-named-groups` features flag:

test262/built-ins/RegExp/named-groups/functional-replace-global.js
test262/built-ins/RegExp/named-groups/functional-replace-non-global.js
test262/built-ins/RegExp/named-groups/groups-properties.js
test262/built-ins/RegExp/named-groups/lookbehind.js
test262/built-ins/RegExp/named-groups/non-unicode-match.js
test262/built-ins/RegExp/named-groups/non-unicode-malformed.js
test262/built-ins/RegExp/named-groups/non-unicode-property-names.js
test262/built-ins/RegExp/named-groups/non-unicode-references.js
test262/built-ins/RegExp/named-groups/string-replace-get.js
test262/built-ins/RegExp/named-groups/string-replace-numbered.js
test262/built-ins/RegExp/named-groups/string-replace-missing.js
test262/built-ins/RegExp/named-groups/string-replace-unclosed.js
test262/built-ins/RegExp/named-groups/string-replace-undefined.js
test262/built-ins/RegExp/named-groups/unicode-match.js
test262/built-ins/RegExp/named-groups/unicode-property-names.js
test262/built-ins/RegExp/named-groups/unicode-references.js
The skip list is here: https://bugzilla.mozilla.org/show_bug.cgi?id=1362169
Depends on: 1367105
This proposal was approved by TC39 and is now part of the ES2018 standard.
It is already supported by current Chrome and by Safari TP.
This proposal was approved by TC39 and is now part of the ES2018 standard.
It is already supported by current Chrome.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P2
This was supported in Chrome 64 and now on Safari 11.1.  Maybe some "parity" tags should be added here.
I've added the parity flags. Hopefully this and other new regexp features like lookbehinds are prioritized at some point!

Sebastian
With Edge rumored to be discontinued soon, Firefox is the only major browser that lacks this feature.

Is there any implementation happening on this? If not, where would I need to look to get started?

(In reply to Jacob Pratt from comment #7)

Is there any implementation happening on this?

As you can see on the previous comments, obviously not, unfortunately.

If not, where would I need to look to get started?

If you mean by that, you want to contribute a patch that implements the feature, you should set up a development environment, read the specification describing the algorithm (maybe also see the proposal for further info), and ask a peer for help where the code lies and how to get started by entering their email address in the "Need more information from" field below the comment box.

Having said that, this feature is presumably rather complex and not something for beginners, but I am not a peer, just another one who can't await that this feature to be implemented.

Sebastian

Type: defect → enhancement

(In reply to Jacob Pratt from comment #7)

Is there any implementation happening on this? If not, where would I need to look to get started?

This feature is tied to its dependency https://bugzilla.mozilla.org/show_bug.cgi?id=1367105. If we can get that one done, we should be able to get all the new RegExp features, not just this one.

I don't think we'll have to implement this from scratch as part of the work is already done, but it's not a simple copy-paste fix either.

(In reply to Sebastian Zartner [:sebo] from comment #8)

read the specification describing the algorithm (maybe also see the proposal for further info) …

I just realized the links I provided are for the wrong feature (lookbehinds, see bug 1225665). Named groups were proposed here.

(In reply to Porama Ruengrairatanaroj from comment #9)

This feature is tied to its dependency https://bugzilla.mozilla.org/show_bug.cgi?id=1367105. If we can get that one done, we should be able to get all the new RegExp features, not just this one.

I don't think we'll have to implement this from scratch as part of the work is already done, but it's not a simple copy-paste fix either.

Thanks for the info, Porama! So, hopefully that one will be picked up again soon!

Sebastian

Media are seeing bustages with https://developer.apple.com/videos/ videos due to scripts used in video playback requiring named capturing groups, per bug 1580895.

Blocks: 1580895

@sdetar, could you check that this has the appropriate priority? It's causing web breakage in at least one known case (bug 1580895).

Flags: needinfo?(sdetar)

Haik, thank you for pointing this out. It seems RegExp features are becoming more of a priority for us to address and we are revisiting/discussing now where this fits into our priority list and how we could resource it.

Flags: needinfo?(sdetar)

Any update on this one?

I am actively working on updating our regexp support, but it is still too soon to be able to say when it will land.

Webcompat Priority: --- → ?

Emma, this is the right one.
The issue in https://webcompat.com/issues/39461
was also reported on Bug 1580895
but the origin of the failure is here. :)
And it's why I had set the seeAlso and the webcompat priority.

Flags: needinfo?(kdubost) → needinfo?(ehumphries)

Oh, I see it now. I saw the notes about A/V error and stopped reading. I should had read further.

Flags: needinfo?(ehumphries)
You need to log in before you can comment on or make changes to this bug.