<input style='width:300px;' type='text' id='yo' value='и слова на ветер и не более да'>
<span id='result'></span>
$(document).ready(function() {
  $("#yo").on("change", function() {
    let text = $(this)
      .val()
      .replace(/(^|\s)[а-я]{1,2}(\s|$)([а-я]{1,2}(\s|$)){0,4}/giu, " ");
    $("#result").text(text);
  });

  $("#yo").trigger("change");
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js