Method: MatchData#select

Defined in:
re.c

#select {|obj| ... } ⇒ Array

Returns an array containing match strings for which block gives true. MatchData#select will be removed from Ruby 1.9.

m = /(.)(.)(\d+)(\d)/.match("THX1138: The Movie")
p m.select{|x| /X/ =~ x}   #=> ["HX1138", "X"]

Yields:

  • (obj)

Returns:



1254
1255
1256
# File 're.c', line 1254

static VALUE
match_select(argc, argv, match)
int argc;