![ישן](https://static.fresh.co.il/images/vBulletin/statusicon/post_old.gif)
07-07-2007, 19:24
|
|
|
חבר מתאריך: 17.06.06
הודעות: 257
|
|
[PHP + REGEX] מי יותר מהיר
כתבתי 2 ביטויים רגלוארים (אותה מטרה רק הדרך טיפה משתנה):
קוד PHP:
$text = preg_replace('#\[COLOR=(\#{1}([\d\w]{3}|[\d\w]{6})|([\w]+?))\](.+?)\[\/COLOR\]#i','<span style="color:\\1;">\\4</span>',$text); $text = preg_replace('#\[COLOR=(\#{1}(([\d\w]{3}){1,2})|([\w]+?))\](.+?)\[\/COLOR\]#i','<span style="color:\\1;">\\5</span>',$text);
השאלה זה איזה מהם יהיה יותר מהיר ולמה?
|