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: 
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))
```
    String txt = "file1.txt file2.jpg tricky file name.txt other tricky filenames containing áéíőéáóó.gif";
    Pattern pattern = Pattern.compile("\\S.*?\\.\\S+"); // Get regex from enrico.bacis
    Matcher matcher = pattern.matcher(txt);
    while (matcher.find()) {
        System.out.println(matcher.group().trim());
    }

```