In todays Programming tutorial I show you how to grab information from a website using Regular Expressions in PHP. The information was particularly hard to get for the following reasons:
It was plain text
There were no tags to search for
Data I wanted was laid out in an unorganized way
I had to search for odd unicode characters like ½
I did it though using Regular Expressions and I’ll show you how.
This is what the data looked like. Actually it wasn’t even this organized. You can see it here
Derby Lane Wednesday Jan 05 2011 Evening Race 1 Grade C (550) Time: 31.02
_________________________________________________________________________
Ctw Triggerhappy 72 1 5 2 2 1 3½ 31.02 3.90 Accelerated On Rail
Hi Noon Rage 65 5 1 1 3 1 2 2 3½ 31.27 5.30 Led To Stretch-placed
The following video will walk you through the code and hopefully teach you more about Regular Expressions and PHP.
All of the code follows the video. If you have any questions or comments leave them below.
Note: You guys have been asking me what politicians mean when they talk about providing tax cuts to companies that ship jobs overseas. I briefly answer that question as well.