Armenian Knowledge Base  

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

Reply
 
LinkBack Thread Tools
Old 04.02.2002, 04:59   #1
»
 
z0mbie's Avatar
 
Join Date: 01 2002
Posts: 777
Downloads: 1
Uploads: 0
Reputation: 0 | 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 ?
Reply With Quote
Old 04.02.2002, 05:31   #2
Moderator
 
acid's Avatar
 
Join Date: 09 2001
Location: South Korea, Gumi
Posts: 7,699
Downloads: 102
Uploads: 34
Blog Entries: 16
Reputation: 561 | 6
Talking

LOL, pochemu kazhdoe slovo? ishesh sobachku (@), potom right poka ne naidesh tochku i left poka ni zakonchatsja alfanumeric...
po moemu tak.
Reply With Quote
Old 04.02.2002, 06:49   #3
Консервативн
 
VX's Avatar
 
Join Date: 01 2002
Location: Кавказская Албания
Posts: 889
Downloads: 0
Uploads: 0
Reputation: 0 | 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
Reply With Quote
Old 04.02.2002, 06:59   #4
Дошкольник
 
Dark Abyss of Yerevan's Avatar
 
Join Date: 01 2002
Location: hell
Posts: 124
Downloads: 0
Uploads: 0
Reputation: 0 | 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]
Reply With Quote
Old 21.03.2002, 18:22   #5
¡no pasaran!
 
dolphin's Avatar
 
Join Date: 03 2002
Location: localhost
Age: 35
Posts: 540
Downloads: 0
Uploads: 0
Reputation: 13 | 4
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';
}

?>
Reply With Quote
Sponsored Links
Reply

Thread Tools


На правах рекламы:
реклама

All times are GMT. The time now is 15:48.


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