How to add a space to a regular expression? What I have:

<input type="text" class="form-control input-lg" id="passport_title" name="passport_title" value="" placeholder="" required=""> 

A mask is connected to this field:

 <script> $(function() { //задание заполнителя с помощью параметра placeholder $("#passport_title").mask("999-999 *************************************************************************"); }); </script> 

Regular script code:

 $.mask = { definitions: { "9": "[0-9]", a: "[A-Za-z]", я: "[А-Яа-я]", "*": "[^a-zA-Z0-9_&nbsp;]" }, autoclear: !0, dataName: "rawMaskFn", placeholder: "_" 

    1 answer 1

    \ s is a space character, and enter it in the regular

    • And how to enter it? "9": "[0-9]", a: "[A-Za-z]", i: "[A-Ya-i]", "*": "[A-Za-z0-9 \ s] " - Anton Bogomolov
    • Try any simple string with a space. in pearl, the space character is entered with two characters \ s - slash and the letter s - vilfred