Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How can we extract string ‘abc.com ‘ from a string
info@abc.com" target="_blank">http://info@abc.com using
regular expression of php?

Answer Posted / rajan vardawaj

We can use the preg_match() function with “/.*@(.*)$/” as
the regular expression pattern. For example:
preg_match(”/.*@(.*)$/”,”info@abc.com”,$data"
target="_blank">http://info@abc.com”,$data); echo $data[1];

Is This Answer Correct ?    2 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to get useful error messages in php?

1047


Are static variables final?

998


How should a model be structured in mvc?

922


What are major variables in research?

982


Define urlencode() and urldecode() used in php?

1182


Explain different sorting function in php?

1061


How does one prevent the following warning ‘warning: cannot modify header information – headers already sent' and why does it occur in the first place?

918


write a note on Testing the web site

1849


What is get and post method in php?

997


Explain me what is the use of 'print' in php?

926


which will print out the php call stack?

967


Do while loops php?

970


How php statement is different from php script?

983


Explain the difference between mysql_connect and mysql_pconnect?

907


What are the characteristics of php variables?

1062