Archive for the 'regular expressions' Category

Regular Expressions, PHP and Newline Characters

Sunday, November 26th, 2006

Ahhhh, regular expressions. They are so handy, but can be such a pain in the ass to use. While coding up a basic script to do a small amount of screen scraping, I remembered a problem I encountered a couple of years ago; one that I was unable to solve at the time. It involves […]

SEO Friendly URL’s with PHP

Friday, July 14th, 2006

I had to come up with a quick little snippet of code to create some SEO friendly urls for dynamic content. What constitutes a SEO friendly url? Basically, just a url with a bunch of words and dashes, nothing to scientific about that. But it does make sense, as the url of this page will […]

Calculations in JavaScript

Monday, July 3rd, 2006

I just finished creating a “value” calculator for a company using JavaScript. It computed the overall value a person would save by joining the organization – nothing fancy, just a couple of input boxes, some simple equations and 10 values to display. What was tricky, at least for a JavaScript neophyte like me, was getting […]

Credit Card Validation with JavaScript and Regular Expressions

Monday, March 20th, 2006

Continuing from the last post, for the javascript I checked the credit card number of form submittal, (along with a lot other things, like required fields, correct phone numbers, etc… ) and if it isn’t correct, throw an alert and prevent the form from submitting (Ignore the PHP tags, haven’t gotten around to adding a […]

Credit Card Validation In PHP With Regular Expressions

Friday, March 17th, 2006

I had to do some credit card validation in both JavaScript and PHP recently. Looking around the net, I found some decent information but no scripts that fit the business rules I was given. There are a lot of different ways to approach validating a credit card. You can go with the loose rule of […]