-
-
Notifications
You must be signed in to change notification settings - Fork 15
Closed
Description
Two things combine to prevent interpolating subroutine definition groups via pattern:
- Interpolated
patterns are always wrapped in(?:…). - Subroutine definition groups must appear at the very end of the expression, not counting the comments and whitespace allowed via implicit flag
x.
One way to fix this would be to update interpolation to check whether, when interpolating a pattern, its value starts with ( and ends with ). If so, it doesn't need to be wrapped. This would have the additional benefit of cleaner source for some regexes that interpolate patterns, even if they don't use subroutine definition groups.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels