I have strings like this:
$5.00 off blah blah
5% off blah blah
This off should not match
I’d like to match strings that start like ^([$]?[\d.]+[%]?) off .*
And converts them to this:
<strong>$5.00 off</strong> blah blah
<strong>5% off</strong> blah blah
This off should not match
Here is what I have right now and stuck (new to Ruby):
def highlight_name(name)
words = name.dup.split
end
This should do the trick:
\\Orefers to the matched string.