You should be very clear about what you want. What are the delimiters? Is it "bg_img_" and "@s_200" or just "_" and "@"? Can the delimiters occur inside the match? That is: Are you going for a maximal or minimal match in cases where there might be more than one? A RegExp can likely solve the problem in any case (and so can non-RegExp code), but it can only do one thing at a tie, so you should be careful to solve the correct problem.
RegExpcan likely solve the problem in any case (and so can non-RegExp code), but it can only do one thing at a tie, so you should be careful to solve the correct problem.