Skip to content

Invalid regular expression: Nothing to repeat #84

@leomontenegro6

Description

@leomontenegro6

I'm trying to highlight some textareas in order to color in red all texts inside curly brackets:

$('textarea').highlightTextarea({
    'words': [{
        'color': 'lightsalmon',
        'words': ['{(.+?)}']
    }]
});

It's working fine for most examples, except when the component tries to highlight curly bracked with only numbers inside:

{1104}{695}{592}{290}{278}{284}{291}

On highlighting, component returns the following error and aborts: "Uncaught SyntaxError: Invalid regular expression: /{1104}/: Nothing to repeat".

I also tried changing the regex to ['{[A-z0-9: ]*}'], but the problem persists.

I'm using version 3.1.3, and jQuery 1.11.0.

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