-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue withSignature Regex #30
Labels
Comments
@garyhalb - Interesting catch. Let me see if I can come up with a test case that addresses the error mentioned. Thanks for documenting! |
BTW, this is what github's library does does: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There appears to be an issue with the original regex defined for matching signatures:
(--|__|-\w)|(^Sent from my (\w+\s*){1,3})
The above correctly matches the phrase: 'Sent from my iPhone' etc.
But the first group also matches any line containing '--', '__' or '-'. So you get matches for any line containing a hyphenated word for instance:
'This is an auto-reply test to see if I receive an automated message'
I've tested this using the online tool at https://regex101.com/ and also using the built-in .Net regular expression matcher.
The fix appears to be to ensure the first group only looks for matches that start with the defined characters:
(^--|^__|^-\w)|(^Sent from my (\w+\s*){1,3})
The text was updated successfully, but these errors were encountered: