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 can we automatically escape incoming data?

983


Which is better php or wordpress?

945


Explain me what is the w3c?

1111


What is php trait?

969


What is the use of array_search() in php?

940


How to set cookies?

1002


How do I escape data before storing it into the database?

973


When do you use define() and when do you use const. What are the main differences between those two?

1061


How should a model be structured in mvc?

926


What is delimiter php?

977


What is the delimiter syntax is PHP's default delimiter syntax

1276


How can I prevent sql-injection in php?

1036


How to find length of an array in php ?

1024


What are the features and advantages of object-oriented programming in php?

938


Which array function checks if the particular key exists in the array?

898