 | News Feed |
Sections
Community Events
Don't see your event here? Let us know!
|
| feed this: |  |
Developer Tutorials Blog: Learn regular expressions in PHP
posted Thursday May 01, 2008 @ 08:48:05
voice your opinion now!
BY CHRIS CORNUTT
On the Developer Tutorials blog, Akash Mehta offers some suggestions of resources and methods for learning how to use regular expressions in your PHP applications.
When it comes to quickly dealing with large blocks of data, batch processing operations or screen scraping, regular expressions are often the most effective solution. There's just one problem, though - learning them can be as hard as learning a new language altogether. Here's how to get off to a flying start.
He points you first in the direction of the preg_* functions then towards a few examples (like with mod_rewrite) and tools to help you understand how things match, like the regex tested extension for firefox and the regular expression cheat sheet on ILoveJackDaniels.com.
tagged with: learn regular expression preg firefox extension cheatsheet
Gareth Heyes' Blog: Regular expression challenge
posted Friday October 19, 2007 @ 14:48:00
voice your opinion now!
BY CHRIS CORNUTT
Gareth Heyes has posted another challenge to his blog - this time it involves using a regular expression to convert the inputted string into the output he's given.
After the success of my "a bit of fun" challenge, a few people asked for some more challenges. So I was answering a question on a mailing list that I'm a member of and I thought it would be a good topic for a little challenge and help sharpen everyone's regular expression skills.
This time, his challenge involves taking the input, rail start/end locations from an array and, via the PHP script given (no regular expression in it, of course) make the output, a sort of JSON formatted message. It's already been answered, but if you want to, try it yourself first then read the answer below the post.
tagged with: regular expression challenge input output match regular expression challenge input output match
DotVoid.com: Parsing the user agent string using PHP
posted Monday January 29, 2007 @ 15:11:57
voice your opinion now!
BY CHRIS CORNUTT
On the Dotvoid.com blog today, there's a new post that shares some handy code to parse out information from the incoming user agent string for the visitors for your site.
Recently I experimented a bit with an Apache log file analyzer written in PHP. It's not all that difficult were it not for trying to parse the browser, or user agent, string. [...] For my purposes I don't care much for the operating system details. This is the result so far. I'm still not very satisfied but I thought maybe other people might be interested and maybe help out.
He provides the code in the format of an encapsulated PHP function that returns the product they're using, the version number of the browser and other various comments.
tagged with: parse user agent string regular expression string parse user agent string regular expression string
Tiffany Brown's Blog: A better RegEx pattern for matching e-mail addresses
posted Wednesday December 13, 2006 @ 08:15:00
voice your opinion now!
BY CHRIS CORNUTT
Though not specifically related to PHP, I wanted to share a helpful tip that Tiffany Brown has posted to her blog today - a nice, compact regular expression to handle the matching of email addresses.
A few weeks ago, I posted a regular expression pattern < href="http://tiffanybbrown.com/2006/11/09/a-pattern-for-matching-e-mail-addresses/">for matching e-mail addresses. Below is a more refined version:
^[-+.w]{1,64}@[-.w]{1,64}.[-.w]{2,6}$
Not only does it match the traditional email address formats, but it also will match addresses with periods in the name, British domains, and new TLDs like '.travel' or '.museum'.
tagged with: regular expression match email address refined regular expression match email address refined
|