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

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -