Skip to content

Issue withSignature Regex #30

@garyhalb

Description

@garyhalb

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})

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions