I'm trying to escape the escape char
(\
) to allow a user to input its username of Active Directory (DOMAIN\username
), but it wont include the character in the input field.
I've used \
, \\
, \\\
and \\\\
in the mask
, and none works. Also tried with the function escapeRegex()
, but have had no success.
How can this be achieved?
JS:
(function ($) {
$.extend($.inputmask.defaults.aliases, {
'ACTIVE-DIRECTORY': {
mask: function(a) {
return a.domain + '\\\\*{1,20}';
},
greedy: false,
definitions: {
'*': {
validator: '[A-Za-z\u0410-\u044F\u0401\u04510-9]',
cardinality: 1,
casing: 'lower'
}
}
}
});
})(jQuery);
EDIT:
This is what it shows in HTML: