@johnotander:
Because g flag is used, the regexp object cannot be used a second time.
A solution to this would be removing the g flag and using start and end anchors, see https://stackoverflow.com/questions/32900659/calling-exec-second-time-returns-null-in-javascript
Concerning matching always the whole string as alternative:
Is this the purpose of this plugin?
Or should it rather match (extract) multiple CSS URL occurrences in a given string?