Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid regular expression: Nothing to repeat #84

Open
leomontenegro6 opened this issue Feb 8, 2018 · 0 comments
Open

Invalid regular expression: Nothing to repeat #84

leomontenegro6 opened this issue Feb 8, 2018 · 0 comments

Comments

@leomontenegro6
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant