Skip to content

RegEx in delayMap prop only allows for single character matching #64

@salesp07

Description

@salesp07

In my case, I wanted a longer delay in every end of sentence. So I came up with this RegEx:

const delayMap = [
  // This regular expression matches every last punctuation character. (Using a negative lookahead)
  { at: /[.!?:;](?![.!?:;])/g, delay: 1000 },
];

But with single char RegEx matching (the current implementation), that's impossible.

It's also impossible to insert a delay after matching words, and pretty much every RegEx that's a bit more complex than a single char.

I managed to make a local fix so I'll submit a PR in a bit.

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