Guest User

Untitled

a guest
Feb 19th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. lines.each do |l|
  2. variables = {
  3. :nmbr => /NMBR = (\d+)$/,
  4. :date => /DATE = (\d+)$/
  5. }
  6. result = {}
  7. variables.each do |name, rgxp|
  8. match = rgxp.match l
  9. result[name] = match[1]
  10. end
  11. result
  12. end
Add Comment
Please, Sign In to add comment