I have a HTML page in a string, and I need to replace all the spaces in the a href references with %20 so my parser understands it.
So for example:
<a href="file with spaces.mp3">file with spaces.mp3</a>
needs to turn into
<a href="file%20with%20spaces.mp3">file with spaces.mp3</a>
One space works fine since I can just use
(.+?)([ *])(.+?)
and then substitute it with %20 in between $1 and $3
But how would you do it for multiple and an unknown number of spaces, while still having the file name to put the %20's in between?