You were very close to the correct solution! You just needed to add a slash (/) so that the greedy [\s\S]* matcher after the staticword captures everything up to the final slash, leaving you free to capture the filename next.
Try the following regex:
([\s\S]*?)staticword[\s\S]*/([\s\S]*?(.css|.js))
It will capture the following groups:
match[0] = /path1/path2/staticword/dynamic/dynamic2/dynamic3/hello.css
match[1] = /path1/path2/
match[2] = hello.css
match[3] = .css
Caveat: due to the greedy matching, you will need to test one path at a time