Skip to content

catastrophic backtracking #4

@preveen-stack

Description

@preveen-stack
const regex = /^(a+)+$/;

// Generate a string that triggers catastrophic backtracking
const input = 'aaaaaaaaaaaaaaaaaaaaa!';

if (regex.test(input)) {
  console.log('Matched!');
} else {
  console.log('No match.');
}

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