Skip to content

Conversation

Golmote
Copy link
Contributor

@Golmote Golmote commented Nov 14, 2017

This PR provides a transform to remove empty groups in optimizer:

/a(?:)b/ -> /ab/
/a|(?:)|b/ -> /a||b/

It does not remove top-level empty group if alone (a.k.a the "empty regexp"):

/(?:)/ is left unchanged.
/(?:)+/ -> /(?:)/

@DmitrySoshnikov
Copy link
Owner

OK, sounds good; thanks!

@DmitrySoshnikov DmitrySoshnikov merged commit e927421 into DmitrySoshnikov:master Nov 15, 2017
@Golmote Golmote deleted the remove-empty-group-transform branch November 19, 2017 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants