I\'m trying to get the first letter of each word in a string using regex, here is what I have tried:
public class Test { public static void main(String[]
Edit Took some suggestions in the comments, but kept the \S because \w is only alpha-numeric and might break unexpectedly on any other symbols.
\S
\w
Fixing the regex and still using split:
name.split("(?<=[\\S])[\\S]*\\s*")