Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- lines.each do |l|
- variables = {
- :nmbr => /NMBR = (\d+)$/,
- :date => /DATE = (\d+)$/
- }
- result = {}
- variables.each do |name, rgxp|
- match = rgxp.match l
- result[name] = match[1]
- end
- result
- end
Add Comment
Please, Sign In to add comment