Looking for some Regex help in Ruby.
I have a string that is formated as so:
YYYY-MM-DD-title-of-post.markdown
I’m looking to use gsub or sub to remove the YYYY-MM-DD portion of the string and do further processing to it.
I would like a Regular Expression to remove the date from the string. The date will never be in a different format.
Thanks for the help!
This should do the trick:
new_title = old_title.gsub('\d{4}-\d{2}-\d{2}','')