Question: I have bundle `A.jar` installed in OSGi and I can get this bundle using BundleContext 

`Bundle bundleA = context.getBundle()`

And a specific classloader B

How can I adding all class from `bundleA` to my classloader B

Answer: 
Regular expresion that enrico.bacis suggested *(\S.*?.\S+)\* will not work if there are filenames without characters before "." like *.project*.

Correct pattern would be:

```
(([^ .]+ +)*\S*\.\S+)

```

You can try it [here](http://regex101.com/r/eU2uW6/1).

Java program that could extract filenames will look like:

```
String patternStr = "([^ .]+ +)*\\S*\\.\\S+";
String input = "file1.txt .project file2.jpg tricky file name.txt other tricky filenames containing áéíoéáóó.gif";
Pattern pattern = Pattern.compile(patternStr, Pattern.MULTILINE);
Matcher matcher = pattern.matcher(input);
while (matcher.find()) {            
    System.out.println(matcher.group());
}

```
If you want to use regular expressions you can find all the occurrences of:

```
(\S.*?\.\S+)

```

(you can test it [here](http://regex101.com/r/uW1aR5/1))