Delete the date of a channel
source link: https://www.codesd.com/item/delete-the-date-of-a-channel.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Delete the date of a channel
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}','')
Related Articles
Why is the form tag necessary to delete the data in laravel 5?
Delete the data in the database by date
Delete the data in sql using ajax and php in XDK
How do I delete the data from the database if one of the insert statements failed
Delete the data that exists in one table and does not exist in the other?
Delete the data in sql table using c # and present it in gridview
How to delete the data from the view list that is checked
When does Cassandra delete the data after it has been deleted?
How do I cancel student courses in the Student Relations table without deleting the data from the database?
Delete the data from an application when it is uninstalled in iOS
How to delete the data before the update
Try to delete the data displayed in my tables
How to delete the data when the application is uninstalled?
How do I delete the date in this table?
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK