I have a regex which matches a string of length between 10 - 15, lower case alphabetic characters like so...
str.replace(/[a-z]{10,15}/g,"replacement word"));
^^ The next step is I'd like to ignore any whitespace whilst matching.
I've tried
str.replace(/[a-z]{10,15}\s*/g,"replacement word"));
and
str.replace(/[a-z]{10,15}\s?/g,"replacement word"));
But it still doesn't ignore whitespace when matching. Even this: "abcdef ghijkl" should be matched because the space is needed to be ignored.
Can anyone experienced with js regex give a hand.