Implement regex to identify partials that should be registered as dependencies

This is the first step of the work: including Michael's regex work
More on:
1. complete the feature.
2. add more tests.