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 / ankush prasad

<?php
$string1="info@abc.com";
$string2=preg_match("/[a-c]+.[c-o]+/",$string1,$a);
print $a[0];
?>

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does the unlink() function mean?

805


Is gender a dependent variable?

741


What is the purpose of the php empty function?

715


What is an associative array?

758


How can I convert ereg expressions to preg in php?

702


What is the w3c?

8727


What do you mean by core php?

707


What language is similar to php?

768


What is namespace and use in php?

746


Explain how can we execute a php script using command line?

738


What is the difference between $name and $$name?

749


how to track user logged out or not? when a user is idle?

726


What is cookies? How to create cookies in php?

709


How to check if a string contains a character or word in php?

782


Php error constants and their descriptions

840