It's a regular expression, and they're greek to even seasoned programmers. You can read more about them here, or check out this cheat sheet to try and learn a little about them.
Basically what a regular expression does is match patterns. Like looking for a string within a string, or a specific order of characters, numbers and symbols within a string. The one you have there is looking for an email address,
$regexp = "^([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)
$inenglish = "^(find anything between a-z, 0-9, or with - or _ in it, at least one or more times)(same as before, but this time it can have a period in it, so it'll match emails like firstname.lastname@example.org or email@example.com)*@(that @ sign is taken literally, so it's looking for the @ sign in the middle of the email.. this pattern and the next are just like the first, looking for any combination of a-z, 0-9 with dashes, underscores or periods allowed)(see previous. The star after this means it can match the whole thing as many times as possible)*(this last pattern is only looking for a pattern which includes a-z, and it needs to be between 2 and 6 characters in length, ie, .tv, .com, .shop, etc.)$";
The ^ means it will begin at the start of the string to find the pattern it wants. Anything between ( and ) or [ and ] is a grouping of sort, and then there are modifiers which tell it how often to try and find specific characters or numbers, such as * for 0 or more times, + for one or more times.. I won't go too much more into specifics of breaking it down for now, but check out those two sites, and the cheat sheet in particular after to see if you can break it down yourself. Email regex's, though numerous in their differences, are a good starting point because they're pretty basic patterns to learn the syntax from.
The Following 2 Users Say Thank You to delayedinsanity For This Useful Post:
Thank you. The repsonses were very helpful. The snippet I cited was from a larger example (in one of my books) that was meant to illustrate the passing of data to a function. But I'm going through each example and trying to learn as much as I can about each detail. Very slow going, but I suppose it is bound to start coming together at some point.
I just ordered a new book myself, "PHP Objects, Patterns, and Practice". Gotta love Amazon, it's supposed to be a $50 book, and I got a used copy for 20 bones. I don't care if my books are new, they're gonna get sat on anyways.
Good luck with it, I'm sure it'll come together. PHP's a great language.