Skip to content

Instantly share code, notes, and snippets.

@jschumann
Forked from anonymous/rubyMatching
Last active December 10, 2015 00:49
Show Gist options
  • Select an option

  • Save jschumann/4354039 to your computer and use it in GitHub Desktop.

Select an option

Save jschumann/4354039 to your computer and use it in GitHub Desktop.
#Functions# {{{
def parse_team_name(line)
teamName = /[[:alpha:]]*/.match(line)
end
def parse_record(line)
record = /[[:digit:]]*-[[:digit:]]/.match(line)
end
def parse_player_name(line)
playerName = /[[:digit:]][[:alpha:]]{2}(.*),/.match(line)[1].lstrip
end
def parse_position(line)
position = /,(.[[:alpha:]]*)/.match(line)[1].strip
end
def parse_points(line)
points = /.[[:digit:]]*$/.match(line).to_s.lstrip
end
def parse_kicker(line)
kicker = /:(.*)/.match(line)[1].lstrip
end# }}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment