“It’s only work if somebody makes you do it.” • craft code • creative ideas • cutting edge • author • senior front end architect • professional scuba diver • adventures above and below the sea level
Location
Germany
Work
Senior Front End Architect, Full Stack Engineer, Creative Technologist and Scuba Diving Professional
thank you for you contribution. You are right, a - surrounded by spaces would count as a word. Unfortunaltey, \W breaks something like "foo-bar" also into two words.
Based on you input I refined the code with a regular expression removing all punctuation chars from the results.
I would love I you have some feedback on this!
Hi Alex,
thank you for you contribution. You are right, a
-surrounded by spaces would count as a word. Unfortunaltey,\Wbreaks something like "foo-bar" also into two words.Based on you input I refined the code with a regular expression removing all punctuation chars from the results.
I would love I you have some feedback on this!
Thank you,
Martin
Non-word-characters only lead to errors if delimited by space on either side. So you can do