I’ve recently been learning how to use perl regular expressions, and while I am by no means an expert - more likely a rank amateur at this point - I did stumble across a really useful cheat sheet for perl regular expressions, just follow the link to download the handy pdf.
Largely I have found regular expressions useful when I’ve been parsing large amounts of data and extracting meaning from it, i.e. giving order to non-structured data.
For instance, I’ve recently been parsing a feed of data from an affiliate network, picking out the products that are relevant to our website, then using my script to determine what category and weight a particular product is from the non-structured descriptive data that is suppliedĀ in the feed.
This has been useful, as it has allowed me to add thousands of products to a database in a really short period of time, much quicker than if I had personally had to go through each record from the feed and manually add the data to our database.
Instead, I’ve been able to simply use the script to parse the data, add it to a temporary table in the database, which feeds into a “sanity checking” workflow, whereby I can simply accept/reject or alter the data, thus saving me days of data entry.