JSFiddle - React, Tailwind, and code Playground
JavaScript
string = "my name is john#doe oh.yeh";
array = string.replace(/#|\./g, ' &$&').split(' ');
alert(array);
string = "my name is john#doe oh.yeh";
array = string.replace(/#|\./g, ' &$&').split(' ');
alert(array);