Misread the question earlier.
English is not my mother language
s{.+(?=/main)}{what ever u need}g; [download]
In reply to Re: Regex for replacement by murugu in thread Regex for replacement by Anonymous Monk