That's much easier to read and therefore understand if one uses a different delimiter for the regex. My preference is to use s{}{} instead of s/// any time I have forward slashes in what I'm trying to match.

That changes the regex to the following which I would hope you could read easier:

Since * is a greedy regexp operator, the 'g' modifier in the end of the regexp is, IMO, meaningless (which could be an indication that this regexp doesn't exactly do what the person who wrote it, had in mind).