klorenz / atom-regex-railroad-diagrams

display regex as railroad diagram, if cursor moves to it
MIT License
250 stars 31 forks source link

Support named captures #68

Closed lordjavac closed 8 years ago

lordjavac commented 8 years ago

Soem languages (e.g. Ruby) support named captures in regexes. It would be nice to label those captures in the diagram instead of "capture x". The syntax in ruby is:

/(?<name>pattern)/

This matches pattern and captures it in a named group for easier referencing. Named captures are exclusive with numbered ones, so there's no need to show the number if we detect named captures.