I want to replace <br>
or <br/>
tags with /n
(newline).
What is the pattern for this with regex?
Ruby:
a = "I want to replace <br> or <br/> tags with /n(newline)."
puts a
a.gsub!(%r~<br\s*\/?>~, "\n")
puts a
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With