Skip to content

Inputmask.escapeRegex error #3

@drybng

Description

@drybng

Takes error in inputmask.js in Inputmask.escapeRegex function;
image

The function is;
Inputmask.escapeRegex = function(str) {
var specials = [ "/", ".", "*", "+", "?", "|", "(", ")", "[", "]", "{", "}", "\", "$", "^" ];
return str.replace(new RegExp("(\" + specials.join("|\") + ")", "gim"), "\$1");

It would be like this;
Inputmask.escapeRegex = function(str) {
var specials = [ "/", ".", "*", "+", "?", "|", "(", ")", "[", "]", "{", "}", "\", "$", "^" ];
return str ? str.replace(new RegExp("(\" + specials.join("|\") + ")", "gim"), "\$1"): str;

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