I have a question. I want to build a regular expression in java script within a loop. I have the string "hi!whats.up" and I want to select in the loop each substring ("hi!","whats","up"), with a regular expression.
Thank you in advance.
You want to use .split() together with a regular expression for symbols.
Something like
"hi!whats.up".split(/[-!$%^&*()_+|~=`{}\[\]:";'<>?,.\/]/)
.forEach(function (word) {
console.log(word);
})
!with the preceding word but not other special characters?