Skip to content

Commit

Permalink
allow defining parsers for non-digit tags (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
prometh07 authored and Maxim committed Jun 3, 2019
1 parent f6d7fb1 commit 753fc26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/cmxl/field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class << self
# Cmxl::Field.parse(':60F:C031002PLN40000,00') #=> returns an AccountBalance instance
#
def self.parse(line)
if line =~ /\A:(\d{2,2})(\w)?:(.*)\z/m
if line =~ /\A:(\w{2,2})(\w)?:(.*)\z/m
tag = Regexp.last_match(1)
modifier = Regexp.last_match(2)
content = Regexp.last_match(3).delete("\r").gsub(/\n\z/, '') # remove trailing line break to prevent empty field parsing
Expand Down

0 comments on commit 753fc26

Please sign in to comment.