When inputting a string with a format:
the beginning
rorR, then some non-digit letters, I want to replace the string withR.
It's in this situation:
onkeyup="this.value=this.value.replace(/^[rR]\D/g,'R')"
But it does not work.
Somebody can help me out? Thanks.
this.value.replace(/^[^r^R]/g,'R')?gmodifier, since a regex which starts at^will match at most once (no multiple substitutions necessary)./^/never requires the g flag, how many "start of strings" are there? ;-)