Project

General

Profile

Actions

Feature #9179

closed

Updated by naruse (Yui NARUSE) over 11 years ago Actions #1 [ruby-core:66095]

  • Status changed from Open to Assigned
  • Assignee set to matz (Yukihiro Matsumoto)

I want to write following code, how do you think matz?

reg = %r<\A(?<scheme>[A-Za-z][+\-.0-9A-Za-z]*):(?<hier-part>//(?<authority>[^/\\?#]+)(?<path-absolute>/[^?#]*)|[^/?#][^?#]*|)(?:\?(?<query>[^#]*))?(?:#(?<fragment>.*))?\z>
url = "http://example.com/hoge?foo=Bar#frag"
reg =~ url
p $~.values_at(:scheme, :authority, :"path-absolute", :query, :fragment)

Updated by naruse (Yui NARUSE) about 10 years ago Actions #2

  • Status changed from Assigned to Closed

Applied in changeset r55036.


  • re.c (match_values_at): MatchData#values_at supports named captures
    [Feature #9179]

  • re.c (namev_to_backref_number): separeted.

Actions

Also available in: PDF Atom