Write a regular expression to get the value xxx from the
string 'xxx@yyy.com'

Answers were Sorted based on User's Feedback



Write a regular expression to get the value xxx from the string 'xxx@yyy.com'..

Answer / bipin

<?php
$string = 'xxx@yyy.com';
list($firstString,$secondString) = split('@',$string);
echo $firstString;
?>

Is This Answer Correct ?    9 Yes 7 No

Write a regular expression to get the value xxx from the string 'xxx@yyy.com'..

Answer / stalin raja.h

<?php
$string = 'xxx@yyy.com';
$sub = substr('$string',0,2);
echo $sub;
?>

Is This Answer Correct ?    2 Yes 0 No

Write a regular expression to get the value xxx from the string 'xxx@yyy.com'..

Answer / tclgeek

set url "xxx@yyy.com"
regexp {([^@]+)@([^.]+).([a-z]+)} $url match match1
puts " Match....$match1"

Is This Answer Correct ?    2 Yes 0 No

Write a regular expression to get the value xxx from the string 'xxx@yyy.com'..

Answer / arun

set chk "xxx@yyy.com"

if {[regexp {([a-z]+)} $chk match one ]} {

puts $one
}

Is This Answer Correct ?    2 Yes 0 No

Write a regular expression to get the value xxx from the string 'xxx@yyy.com'..

Answer / sunil kumar

hello Bipin bhaiya, ur program is right but when I run this
program I encountered an error and i.e.

Deprecated: Function split() is deprecated in
C:\wamp\www\Test\aa.php on line 3


pl.tell me what`s that error


sunilnagpal30@yahoo.in

Is This Answer Correct ?    0 Yes 0 No

Write a regular expression to get the value xxx from the string 'xxx@yyy.com'..

Answer / ren

set url "xxx@yyy.com"
regexp {([^@]+)@([^.]+).([a-z]+)} $url match
puts " Match....$match"

Is This Answer Correct ?    1 Yes 1 No

Write a regular expression to get the value xxx from the string 'xxx@yyy.com'..

Answer / tclgeek.com

set url "xxx@yyy.com"
regexp {(\w+)@.+\.com} $url match
puts "Match is--->$match"

Is This Answer Correct ?    0 Yes 0 No

Write a regular expression to get the value xxx from the string 'xxx@yyy.com'..

Answer / 23626

set url "xxx@yyy.com"
regexp {[^@]+} $url M1
puts $M1

Is This Answer Correct ?    0 Yes 0 No

Write a regular expression to get the value xxx from the string 'xxx@yyy.com'..

Answer / esorimer

preg_replace("/(.*)@(.*)/","\1",$string);

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More PHP Interview Questions

What are php applications?

0 Answers  


what does this symbol mean in php?

0 Answers  


What is the correct line to use within the php.ini file, to specify that 128mb would be the maximum amount of memory that a script may use?

0 Answers  


Where are php configuration settings stored?

0 Answers  


How do you access a get requests url parameter with php?

0 Answers  






What is the difference between "echo" and "print" in php?

0 Answers  


Tell me will a comparison of an integer 12 and a string "13" work in php?

0 Answers  


What are the differences between include() and include_once () functions?

12 Answers  


How to find a specific value in an array?

0 Answers  


What does empty mean in php?

0 Answers  


Which php framework is in demand?

0 Answers  


What is difference between post and put in rest?

0 Answers  


Categories