Prevent loose parser from tripping on invalid regexps

Issue #39