Permalink
Browse files

Fix regex bug

GEDCOM lines can end in either \r or \n (or both).
  • Loading branch information...
1 parent e4a0c01 commit c7f6a60afe488724223a3f94d9d90ac9335a6990 Madeleine Ball committed Apr 10, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 gedcom.py
View
@@ -88,7 +88,9 @@ def __parse_line(self, line_num, line, last_elem):
# Tag must be alphanumeric string
'([A-Za-z0-9_]+)' +
# Value optional, consists of anything after a space to end of line
- '( .*|)$'
+ '( [^\n\r]*|)' +
+ # End of line defined by \n or \r
+ '(\r|\n)'
)
if re.match(ged_line_re, line):
line_parts = re.match(ged_line_re, line).groups()

0 comments on commit c7f6a60

Please sign in to comment.