Howdy folks,
I've been up and down the regex tutorials and, quite frankly, don't "get" it.
I'm trying to do the follow;
I have a string as such:
perl-HTML-Format.noarch 2.04-6.el5.art atomic
I'm trying to figure out how to match the string with regex and take only the perl-HTML-Format and the version portion of the string. The spacing between the package name and version number is not knowable beforehand.
I can't exactly explode() on a space as that will give me a huge list of empty array entries with the second element I want placed randomly within that list. I'm thinking a regex would be far more elegant than that.
I'm probably over-thinking it.
I'd assume a preg_match_all would be the magic in this case, just don't know how to write out the regex. It just doesn't make sense to me.
Halp!
-G