I don’t know PostgreSQL, but it works using the rails console:
Post.find_each do |p|
p.raw.gsub!(/"(.*?)"\:(http\S+?(?=\W+(?:$|\s))|http\S+)/, '[\\1](\\2)')
p.save
end
I don’t know PostgreSQL, but it works using the rails console:
Post.find_each do |p|
p.raw.gsub!(/"(.*?)"\:(http\S+?(?=\W+(?:$|\s))|http\S+)/, '[\\1](\\2)')
p.save
end