I am working on creating a regular expression that matches and groups in the following way:
Example input:
hello.world1/world2/index.js
Example desired regex grouping:
[hello].[world1/world2]/[index.js]
Where anything NOT inside the brackets is ignored. I currently have this Regex: (^.*\.)(.*\/)(.*$) and is capturing the following:
Notice how group 1 includes the period and group 2 includes the last slash. Both which I don't want. Any help to correct this regex would be appreciated.

