i need a Regex to do this ( catch only real words ):
Inputstring:
hello,sdfsdf.....yahoo@email.com
Process:
String theMagicRegEx = "?????";
String[] arrayvar = asdf.split(theMagicRegEx);
Output (arrayvar) should be this:
hello
sdfsdf
yahoo
email
com
Question: What is the value of theMagicRegEx?
Thanks a lot
Try
str.split("[\\W\\d_]+");.This will leave only word characters, no numbers or underscore.