import java.util.regex.Pattern;
import java.util.regex.Matcher;
public class MyClass {
public static void main(String args[]) {
String s = "java c c++ c# php python";
Pattern p = Pattern.compile("[a-zA-Z+#]+");
Matcher m = p.matcher(s);
while (m.find()) {
System.out.println(m.group());
}
}
}
/*
run:
java
c
c++
c#
php
python
*/