You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like the regex crate requires that all of the named capture groups have a unique name. Maybe it could allow use of the same name in different branches of the disjuction operator (|).
For example the javascript regex engine allows this (quote):
All names must be unique within the same pattern. Multiple named capturing groups with the same name result in a syntax error.
This restriction is relaxed if the duplicate named capturing groups are not in the same disjunction alternative, so for any string input, only one named capturing group can actually be matched. This is a much newer feature, so check browser compatibility before using it.
/(?<year>\d{4})-\d{2}|\d{2}-(?<year>\d{4})/;
// Works; "year" can either come before or after the hyphen
Could make some "simple parsers" a little bit nicer.
The text was updated successfully, but these errors were encountered:
It looks like the regex crate requires that all of the named capture groups have a unique name. Maybe it could allow use of the same name in different branches of the disjuction operator (
|
).For example the javascript regex engine allows this (quote):
Could make some "simple parsers" a little bit nicer.
The text was updated successfully, but these errors were encountered: