For Example:
The words = "Hallo, über Wörterbuch?!";
should be splitted in to an array list as:
["Hallo", ",", "über", "Wörterbuch", "?!"]
But with words.split(/\s|\b/g)
, I will only get
["Hallo", ",", "ü", "ber", "W", "ö", "rterbuch", "?!"]
So it seems that the "ö" has been considered as the boundary. Is there any solution for solving this kind of problem? Thank you in advance!
Sorry, please don't close this question, none of the existing questions work with my case, unless you can give an answer.