Question : Regex to find webpage title

Hey all.

I'm looking for a regular expression to find the title of a webpage. The expression i've managed to scrape together so far is:

preg_match('/<title>(.*?)<\/title>/is',$text,$matches);

This works perfectly if the title is formatted as <title>Page Title</title> however if the webpage has a class or ID attached to the title tag everything goes wrong. So basically what i'm looking for is an expression that looks for the starting tag <title> but also ignores any text between "<title" and ">". Also if you can think of any other variations of the title tag it would be great to get them worked into the expression as well.

An explanation of the provided expression would also be massively appreciated (though don't feel like you must), regular expressions have so far eluded me and i'd really like to get to grips with them.

Thanks for any help recieved

Answer : Regex to find webpage title

The R2 will handle the configuration you have with the caveat that you do not overextend the ram by running multiple applications in terminal server.  Not sure what is cost prohibitive on the memory installation as it would undoubtedly be cheaper than scrapping an OS you have allready paid for.  Either way r2  with the processor and ram you have will handle the config as a stand alone.
Random Solutions  
 
programming4us programming4us