I am trying to get from a text string only alphanumeric values. But in turn I want to exclude numbers that are loose . Namely:
const miString = 'hola! 8932p ++ 1234 automovil v2 etc 399';
const resultado = miString.replace(/[^a-zA-Z0-9\u00C0-\u00ff]+/g, ' ');
console.log(resultado); // hola 8932pe 1234 automovil v2 etc 399
The ideal, and I'm not giving it no matter how many examples I find:
console.log(resultado); // hola 8932pe automivil v2 etc
PS: u00C0-\u00ff
I implement it to accept different encoding formats.
I put a solution in another regular expression...
The \b modifier allows to search only complete "words" and the \d modifier indicates digits. With which when putting
\b\d+\b
we are limiting to complete words that include 1 or more digits.