Go Back   Armenian Knowledge Base > Technical sections > Languages, Compilers, Interpreters > Algorithms

Reply
 
Thread Tools

emails from HTML
Old 04.02.2002, 04:59   #1
»
 
z0mbie's Avatar
 
Join Date: 01 2002
Posts: 777
Rep Power: 0
Post emails from HTML

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 ?

Old 04.02.2002, 05:31   #2
Moderator
 
acid's Avatar
 
Join Date: 09 2001
Location: South Korea, Gumi
Posts: 7,699
Blog Entries: 16
Rep Power: 7
Talking

LOL, pochemu kazhdoe slovo? ishesh sobachku (@), potom right poka ne naidesh tochku i left poka ni zakonchatsja alfanumeric...
po moemu tak.

Old 04.02.2002, 06:49   #3
VX
Консервативн
 
VX's Avatar
 
Join Date: 01 2002
Location: Кавказская Албания
Posts: 889
Rep Power: 0
Post

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
__________________
Праздник к нам приходит...

|^^^^^^^^^'''^\| ||\__
| ВОДКА-ВОДКА | ||','''|'''''''\_____,_
| _..... _ | ||_ _|'__|_____||.........| |
'(@)'(@)'(@)''''''''''''''''''''''*|(@)""""|(@)*

Old 04.02.2002, 06:59   #4
Дошкольник
 
Dark Abyss of Yerevan's Avatar
 
Join Date: 01 2002
Location: hell
Posts: 124
Rep Power: 0
Post

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]

Old 21.03.2002, 18:22   #5
¡no pasaran!
 
dolphin's Avatar
 
Join Date: 03 2002
Location: localhost
Age: 43
Posts: 540
Rep Power: 5
Exclamation

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 = &quot;gashfjgsdk mailto:[email protected] hsf \n jdkshhs [email protected]&quot;;

if(preg_match_all(&quot;/[0-9a-zA-Z_\.\-]+?@[a-zA-Z0-9a-zA-Z_\-\.]+\.[a-zA-Z_]{2,}/s&quot;,$test,$matches,PREG_SET_ORDER)) {

    foreach($matches as $m) {
        echo $m[0].&quot;<br>\n&quot;;
    }

}
else {
    echo 'zzzzZZZ';
}

?>
__________________
[ que fors aus ne le sot riens nee ]
Reply




Реклама:
реклама
Buy text link .

All times are GMT. The time now is 12:46.
Top

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.