ユーザーが次のように入力した場合:
my name is jackson5 model number 5g1 |nR%1b and I would 644 like to say 55 hello to all the tags of html in the world.
55 の hello を 55hello に置き換えたいのですが、入力ボックスにしゃっくりや中断が発生することなく入力を続けます。
これまでの私のコードは次のとおりです。そこに正規表現ステートメントがありますが、55 hello の間のスペースを置き換えて 55 hello にする方法がわかりません。
<script type="text/javascript">
function isValid(strQuery){
var regStatement =/[0-9]+ hello/;
if (regStatement.test(strQuery.value)) {
strQuery.value = strQuery.value.replace("$2","");
}
}
</script>
<input type="text" id="wtf" name="search_query" onkeyup="isValid(this);" />