FRIHOST • FORUMS • SEARCH • FAQ • TOS • BLOGS • COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Can someone tell what exactly this regex do





imagefree
Here's the regular expression:

Code:
'/(?<=<title>).*?(?=<\\/title>)/is'


What i know is it fetches the title of a page. But this is what the below regex can do too:

Code:
'/<title>(.*?)<\/title>/is'


What extra the 1st regex does: like checking invalid title tag closings, handling with multiple titles, title in-existence etc?

Also please tell which one is better on the practical web where people type careless html, or suggest corrections if there is any bug in both above.

Thanks.
kacsababa
Basicly, the first one only matches the title itself without the the tags.
The second one matches the tags too and groups the title itself.
Thats all.
Related topics
SQL Tutorial
Can someone explain how google works exacly?
Girlfriend!! Girlfriend!! Girlfriend!!
Divs and Tables
Points $FRIH system?
Hosting Signups?
Znów sie zaczyna:(
REferencial Integrity in databases
"if" statements
Is She Playing Games With Me?
Windows is freer than Linux
maplestory
phpBB3 ~~ Board Features Problem
I Got Attacked.
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.