News Feed
Jobs Feed
Sections

Recent Jobs

News Archive
feed this:

Ken Guest's Blog:
Validation in Depth - a retort to using just regular expressions
May 27, 2008 @ 07:58:54

Ken Guest, in a response to another post from a different blogger, has posted some of his own validation replacements for the regular expression method the other blogger chose.

I've noticed that Richard Heyes, who professes himself to be a php guru, deleted my comment on his "Some common regular expressions" posting which simply pointed out his expressions didn't quite do the job and suggested a few PEAR packages that should be used instead of the expressions that he proffered

His examples have the benefit of what he calls "defense in depth" - the functionality to catch a bit more than just a regular expression can alone. His examples include PEAR_Validate for email addresses, Net_CheckIP2 for IP addresses and the Validate_UK package for the sort code and telephone numbers.

0 comments voice your opinion now!
pear package regular expression validate email telephone ipaddress domain



Eirik Hoem's Blog:
Handy online regex tool for PHP, Perl, JS and Python
May 06, 2008 @ 12:09:14

Eirik Hoem has pointed out an online tool a coworker shared with him to work with regular expressions for multiple languages.

A coworker of mine has been working on a ajax enabled regex tool which lets you evaluate regex expressions in several languages (including PHP PCRE and PHP POSIX) with instant results.

The tool lets you put in the string you want to match again and the pattern you want to match with. The results are automatically populated below it, making it easy to fine-tune your expression to only what you want.

0 comments voice your opinion now!
regular expression tool online perl javascript python


Developer Tutorials Blog:
Learn regular expressions in PHP
May 01, 2008 @ 08:48:05

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.

0 comments voice your opinion now!
learn regular expression preg firefox extension cheatsheet


IBM developerWorks:
Mastering regular expressions in PHP, Part 1
January 04, 2008 @ 15:08:00

The IBM developerWorks website has posted the first part of a series they've created to help PHP developers become more informed about what regular expressions are and how they can harness their power for their applications.

Pattern matching is such a common chore for software that a special shorthand '" regular expressions '" has evolved to make light work of the task. Learn how to use this shorthand in your code here in Part 1 of this "Mastering regular expressions in PHP" series.

In this first part of the series, they look at the basics - the idea behind regular expressions, some of the common operators, the PHP functions to use them and example of how to use them to match/split out strings and capture just the data you need from the given input.

0 comments voice your opinion now!
regular expression function series introduction operator regular expression function series introduction operator


Gareth Heyes' Blog:
Regular expression challenge
October 19, 2007 @ 14:48:00

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.

0 comments voice your opinion now!
regular expression challenge input output match regular expression challenge input output match


Joey's Blog:
8 Practical PHP Regular Expressions
October 17, 2007 @ 10:27:00

On his web development blog, Joey has posted a new list of eight handy regular expressions you can use in your code for common validations.

Here are eight examples of practical PHP regular expressions and techniques that I've used over the past few years using Perl Compatible Regular Expressions. This guide goes over the eight different validation techniques and describes briefly how they work. Usernames, telephone numbers, email addresses, and more.

Each of the regular expressions comes complete with an explanation of what it is and the kinds of strings it's looking for. Comments on the post have helped even more, finding places where they might break or not catch all possibilities.

0 comments voice your opinion now!
regular expression list practical username phone email zip ipaddress date regular expression list practical username phone email zip ipaddress date


DotVoid.com:
Parsing the user agent string using PHP
January 29, 2007 @ 15:11:57

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.

0 comments voice your opinion now!
parse user agent string regular expression string parse user agent string regular expression string


Zend Developer Zone:
PHP and MySQL By Example - Sample Chapter
January 02, 2007 @ 10:25:00

The Zend Developer Zone has posted a bit of info of special interest to those out there working with PHP and MySQL. Prentice Hall has posted a sample chapter of their "PHP and MySQL By Example" book for public consumption.

Most developers I know of either love or hate Regular Expressions, me personally, I hate them. Yes, they do the job and usually do it elegantly but it's hard to find a more arcane sub-language than regex.

Obviously, the sample chapter talks about regular expressions - specifically what they are, what functions in PHP use them, their use, and enough examples to keep you busy for a long time.

Want to share this story with more people? Digg it!

0 comments voice your opinion now!
mysql sample chapter prenticehall regular expression mysql sample chapter prenticehall regular expression


Tiffany Brown's Blog:
A better RegEx pattern for matching e-mail addresses
December 13, 2006 @ 08:15:00

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'.

0 comments voice your opinion now!
regular expression match email address refined regular expression match email address refined


Felix Geisendorfer's Blog:
Validating the cleaned output of HtmlHelperdateTimeOptionTag()
October 17, 2006 @ 08:18:00

Felix Geisendorfer keeps it short and sweet in this latest post. He shares a regular expression to validate the output of the HtmlHelper method dateTimeOptionTag.

Ok, let's make this short and painless. I just needed to validate the (cleaned) output of an HtmlHelper::dateTimeOptionTag() to be a correct datetime value matching this format.

The regular expression is fairly simple (long, but simple) and he shows a simple way to include it into a model (in the special $validate array) to check the contents of the 'start' field).

0 comments voice your opinion now!
cakephp framework model regular expression validate datetime cakephp framework model regular expression validate datetime



Community Events











Don't see your event here?
Let us know!


ajax framework release package conference code zendframework PHP5 zend mysql security job application book developer releases PEAR database example cakephp

All content copyright, 2008 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework