I have this RegExp
this.value = this.value.replace(/(^((?!(\n|[0-9])).)*$)/mg,'');
That replaces everything except digits and new lines.
The problem is that if I have a string like this: word_and_numbers123123123 the RegExp doesn’t replace the letters.
Every thing
/(^((?!(HERE)).)*$)/
is, as far as i am concerned, NOT removed.
Im simply using \n|[0-9]
Where “HERE” is, so, full RegExp:
/(^((?!(\n|[0-9])).)*$)/
But the problem, is once again, that it, the RegExp, doesn’t remove %$word in for example this string: %$word_2143234
Maybe I have misunderstood. Why not simply do the replace without the negative look ahead?
this should replace