ruby - Regex to match last occurrence -
As I do not want to spend the correct regex googling another hour: I want to delete the last backslash of a given string With Gsub:
"C: \ Program Files \" Gsub (fancy_regex_here, '') # = & gt; "C: \ Program Files"
Thanks in advance for any help
should be fancy_regex_ "\\ $"
Comments
Post a Comment