Chapter 11. Regular Expressions: Rules for replacement

image with no caption

String functions are kind of lovable. But at the same time, they’re limited. Sure, they can tell the length of your string, truncate it, and change certain characters to other certain characters. But sometimes you need to break free and tackle more complex text manipulations. This is where regular expressions can help. They can precisely modify strings based on a set of rules rather than a single criterion.

Risky Jobs lets users submit resumes

Riskyjobs.biz has grown. The company now lets job seekers enter their resumes and contact information into a web form so that our Risky Jobs employers can find them more easily. Here’s what the form looks like:

image with no caption

Our job seeker information is stored in a table that can be searched by employers, recruiters, and headhunters to identify potential new employees. But there’s a problem... the data entered into the form apparently can’t be trusted!

image with no caption

Get Head First PHP & MySQL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.