![]() | |
| |||||||
| Home | Register | Blogs | FAQ | Members List | Calendar | Downloads | Arcade | Mark Forums Read |
| Algorithms The source of algorithms for your project |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 |
| » | v obshem nado poluchit' e-mail adresa iz html file-ov, tol'ko proveryat' kazhdoe slovo mail eto ili net slishkom dolgo.. u kogo-nit' est' soobrazheniya po etomu povodu ?
__________________ •·•· ·•·· ·· •·•· •·• |
| | |
| | #3 |
| Консервативный Демагог Join Date: Jan 2002 Location: Кавказская Албания
Posts: 889
Rep Power: 7 Reputation:
10 | Lol Acid , xoroshee reshenie. v C est' regexp.h (ya eto videl v Unixe), vot ego i vrubaem <img src="smooch-1.gif" border="0"> shablon napi****e sami <img src="wink-5.gif" border="0"> )) toje samoe mojno ocen' krasivo zdelat' v perle
__________________ Праздник к нам приходит... |^^^^^^^^^'''^\| ||\__ | ВОДКА-ВОДКА | ||','''|'''''''\_____,_ | _..... _ | ||_ _|'__|_____||.........| | '(@)'(@)'(@)''''''''''''''''''''''*|(@)""""|(@)* |
| | |
| | #4 |
| Дошкольник | orinak php ov mi hat regexp a (chem stugel bayc senc mi ban petqa lini) preg_match_all("/^[0-9a-zA-Z_\.\-]+@([a-zA-Z0-9a-zA-Z_\-]+\.)+[a-zA-Z_]{2,}$/",$html,$matches) $matches @ darnuma mi hat array vori mej sagh gtac emailnerna preg_match_all -- Perform a global regular expression match Description int preg_match_all (string pattern, string subject, array matches [, int order]) Searches subject for all matches to the regular expression given in pattern and puts them in matches in the order specified by order. After the first match is found, the subsequent searches are continued on from end of the last match.
__________________ [x]-=-[ ]-=-[x] |
| | |
| | #5 |
| ¡no pasaran! | predyduschij primer nepravil'nyj!!! est' oshibka b regexpe dlja preg_match_all (`^` i `$` ne imeet smysla ispol'zovat' i objazatelen modifikator `s` dlja mnogostrochnogo texta) this should work Code: <?
$test = "gashfjgsdk mailto:dolphin@freenet.am hsf \n jdkshhs me@some.other.net";
if(preg_match_all("/[0-9a-zA-Z_\.\-]+?@[a-zA-Z0-9a-zA-Z_\-\.]+\.[a-zA-Z_]{2,}/s",$test,$matches,PREG_SET_ORDER)) {
foreach($matches as $m) {
echo $m[0]."<br>\n";
}
}
else {
echo 'zzzzZZZ';
}
?>
__________________ [ que fors aus ne le sot riens nee ] |
| | |