News Feed
Sections

News Archive


Community Events






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


feed this:

Ken Guest's Blog:
Validation in Depth - a retort to using just regular expressions
0 comments :: posted Tuesday May 27, 2008 @ 07:58:54
voice your opinion now!

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.

tagged with: pear package regular expression validate email telephone ipaddress domain


Eirik Hoem's Blog:
Handy online regex tool for PHP, Perl, JS and Python
0 comments :: posted Tuesday May 06, 2008 @ 12:09:14
voice your opinion now!

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.

tagged with: regular expression tool online perl javascript python

Developer Tutorials Blog:
Learn regular expressions in PHP
0 comments :: posted Thursday May 01, 2008 @ 08:48:05
voice your opinion now!

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

IBM developerWorks:
Mastering regular expressions in PHP, Part 1
0 comments :: posted Friday January 04, 2008 @ 15:08:00
voice your opinion now!

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.

tagged with: regular expression function series introduction operator regular expression function series introduction operator

Gareth Heyes' Blog:
Regular expression challenge
0 comments :: posted Friday October 19, 2007 @ 14:48:00
voice your opinion now!

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

Joey's Blog:
8 Practical PHP Regular Expressions
0 comments :: posted Wednesday October 17, 2007 @ 10:27:00
voice your opinion now!

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.

tagged with: 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
0 comments :: posted Monday January 29, 2007 @ 15:11:57
voice your opinion now!

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

Zend Developer Zone:
PHP and MySQL By Example - Sample Chapter
0 comments :: posted Tuesday January 02, 2007 @ 10:25:00
voice your opinion now!

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!

tagged with: 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
0 comments :: posted Wednesday December 13, 2006 @ 08:15:00
voice your opinion now!

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

SitePoint PHP Blog:
The Joy of Regular Expressions [4]
0 comments :: posted Monday October 30, 2006 @ 15:34:00
voice your opinion now!

Harry Fuecks brings the next part of his "Joy of Regular Expressions" series to the SitePoint PHP Blog today with part four, building on the previous how-tos: part one, part two, and part three.

He looks at a few different topics this time - date checking, making dates more user-friendly, exploding with patterns, and capturing split delimiters. Just like in the previous articles in the series, he explains in what kind of situation the expression would be used and the sample code showing how to use it (oh, and the output too).

tagged with: regular expresssion joy tutorial example situation regular expresssion joy tutorial example situation


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

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