LAMP How To – Open Source At Work

Only Passion Matters

Entries for the ‘Think Regular Expression’ Category

Automating No-Follow Attribute Using Regex

I wrote a script to automate the process of adding no follow attribute in user submitted comments using regular expression. this is necessary to prevent spam (wordpress already has a plugin for that)… You might need it else where, who knows?
See http://sitecritic.net/articleDetail.php?id=242

Form Checking – Verifying Name Using PHP Ereg

One important use of Regular Expressions (Regex) is to verify fields submitted via a form. In this article, we attempt to write an expression that is able to verify the user’s first name, middle name, last name or just names in general.
The expression should allow names such as “Mary”, “Mr. James Smith” and “Mrs O’Shea” [...]

Introduction to Regular Expressions In PHP

In Linux and Unix, the syntax that is commonly used by many applications for specifying text patterns is known as regular expressions or in short form – regex. Regex is a very powerful technique to describe patterns and many programs use them to describe sequences of characters to be matched. Search programs such as ‘grep’ [...]