In JavaScript I would like to replace all spaces that don't match the following Regex with percentages (%):
\b[a-zA-Z]\s\b
I try to exclude all the spaces that sit next to a single character and replace all the other. In case:
True that A B C School is great for kids and C D E School is not
all the spaces except these between A-B and B-C and C-S should be replaced with percentages. So the result is:
True%that%A B C School%is%great%for%kids%and%C D E School%is%not
I read:
but it didn't give me the ultimate answer.
Currentlyquery.replace(\b[a-zA-Z]\s\b,'%')
replaces exactly the spaces that should be left as they are.
Could you advise how to negate my expression in the correct way?