Skip to content

Bad regex causing very slow execution #112

Description

@kduffie

If you attempt to run unfluff on the body of the following webpage, https://craftsbyamanda.com/vibrant-button-tree-on-canvas-a-giveaway/ you'll see that it takes more than 10secs on a fast Mac.

The problem has been isolated to line 22 of lib/extractor.js which takes around 10s to execute when operating on the contents of that particular webpage:

copyright = text.replace(/.*?©(\s*copyright)?([^,;:.|\r\n]+).*/gi, '$2').trim();

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions