I would like to have a regular expression to extract the path from a full file location

For example, having a path

```
#/home/java/bin/myfile

```

The regular expression should extract `/home/java/bin/`