We're trying to parse the GEDCOM file format. According to its standard, all combinations of CR and LF are valid to denote a newline break.
It's a line based format, so often we want to match the rest of the line when we've already matched the number and the tag. An example of a rule would be
"NAME ".+ { /* deal with the name */ }
The newlines are matched by
[\r\n]+ {return ENDLINE;}
This works fine on Windows, because it converts \r\n to \n behind your back, but it doesn't on Linux. There, \r can be matched by the dot. Because Flex uses the longest matching rule, it will either include the \r in the data, or it will match a known tag to the UNKNOWNTAG rule because this technically correct match will be one byte longer
A solution could be to replace all dots with [^\r\n], but that seem inelegant. Is there a better way?