#regular expressions
3 posts tagged regular expressions. Clear filter
-
A Regular Expression to Generate Dash Separated Slugs AKA Pretty URLs
This regular expression matches non alphanumeric characters in a string. You can use it to create URL friendly slugs. In combination with Stringgsub it will replace the non alphanumeric characters...
-
How to Extract the Title From an HTML Page with Ruby
This snippet will make a request to this page and extract the title from the title tag. The regular expression here matches everything between the title tags. Anything within the parens "(.\)" is...
-
Email Obfuscation and Extraction from Text with Rails
There is a helper method for handling the obfuscation of email addresses in Rails. If you want to then extract an email address(or all email addresses) from a block of text here is the code. I...