Escaping a backslash in a regex

Escape it with \:

[1] pry(main)> 'A title covering T8/2024'.gsub(/T8\/2024/, 'T9/2024')
=> "A title covering T9/2024"
6 Likes