Regex replace for String, 3 characters from the end -
i have been able add space string in input field using following:
onkeypress="this.value=this.value.replace(/^(\w{5})(?=\w)/,'$1 ')"
but count start end of line, , add space after user input has stopped. i've tried onblur, not seem work in chrome.
any tips?
thanks
just guess -
onkeypress="this.value=this.value.replace(/(\w{5})(?=\w$)/,'$1 ')"
Comments
Post a Comment