Hi everyone,
I have a little problem with preg_match function. What i wanted to do is get all the matching keywords out of a given string. I have done so many tries but couldnt figure it out yet.
below i have given the code that i have done. But the problem with that code is that its always return the first match.
$str = '
The data contained in GoDaddy.com, Inc.\'s WHOIS database,
while believed by the company to be reliable, is provided "as is"
with no guarantee or warranties regarding its accuracy. This
information is provided for the sole purpose of assisting you
in obtaining information about domain name registration records.
Any use of this data for any other purpose is expressly forbidden without the prior written
permission of GoDaddy.com, Inc. By submitting an inquiry,
you agree to these terms of usage and limitations of warranty. In particular,
you agree not to use this data to allow, enable, or otherwise make possible,
dissemination or collection of this data, in part or in its entirety, for any
purpose, such as the transmission of unsolicited advertising and
solicitations of any kind, including spam. You further agree
not to use this data to enable high volume, automated or robotic electronic
processes designed to collect or compile this data for any purpose,
including mining this data for your own personal or commercial purposes.
Please note: the registrant of the domain name is specified
in the "registrant" field. In most cases, GoDaddy.com, Inc.
is not the registrant of domain names listed in this database.
Registrant:
shehanme
#6, Fdsatdsdimdsdsdsdsdsda Road,
Kapdsdsduwatdsdsdsdsta,
Jaedsdsdsdsla, 11350
Sdsdsdri Ladsndsdsdska
Registered through: GoDaddy.com, Inc. (http://www.godaddy.com)
Domain Name: SHEHANME.COM
Created on: 18-Jul-07
Expires on: 18-Jul-08
Last Updated on: 22-Jul-07
Administrative Contact:
Fernando, Shehan shdsdehdsdsdsdan_me@yahdsdsdsdsdoods.codsm
shehanme
#6, Fatdsdsdsima Rsdsdsdsdsdoad,
Kapusdsdsdgjkkdsdswatta,
Jdsdkjskldjskldaela, 11350
Ssdsdhlri Ladsdgsjdksjkdnka
Technical Contact:
Fernando, Shehan shsajmsajkhsjkhalskllajskjalsaehasasame@yahsahjsgjhagsjhagsjasoo.com
shehanme
#6, Fatdsdsdsima Rsdsdsdsdsdoad,
Kapusdsdsdgjkkdsdswatta,
Jdsdkjskldjskldaela, 11350
Ssdsdhlri Ladsdgsjdksjkdnka
Domain servers in listed order:
NS1.EKWA.COM
NS2.EKWA.COM
NS5.SECURESERVER.NET
NS6.SECURESERVER.NET
Registry Status: clientRenewProhibited
Registry Status: clientTransferProhibited
Registry Status: clientUpdateProhibited
Registry Status: clientDeleteProhibited
See Underlying Registry Data
Report Invalid Whois
';
$exp = "/NS[0-9]\.[a-z][A-Z]*\.[a-z][A-Z]*/i";
preg_match($exp,$str, $matches);
while(list($aa,$bb) = each($matches))
{
print $aa." = ".$bb."<br />";
}
what am i doing wrong here??😕
any help greatly appreciate it..
thanks in advance,
Regards,
niroshan