Class | MatchData |
In: |
lib/facet/matchdata/match_from.rb
lib/facet/matchdata/match.rb |
Parent: | Object |
Return the primary match, equivalent to +md[0]+.
require 'facet/matchdata/match' md = /123/.match "123456" md.match #=> "123"
Returns the post_match from subexpression n.
require 'facet/matchdate/match_from' md = /x(a)(b)(c)z/.match "123xabcz789" md.post_match_from(0) #=> 789 md.post_match_from(1) #=> z789 md.post_match_from(2) #=> cz789 md.post_match_from(3) #=> bcz789 md.post_match_from(-1) #=> bcz789