I need to get the content present between .tc_XXXX_1(Rexp should be tc followed by the content followed by _and a digit) in the $var
XXXX can contain specialchar,Alp habets or Numerals. Not sure why $2 prints "n" in the below code.
[code=perl]
$var="test.tc__ na1me_1.2008061 6184340025";
if($var=~/(tc)__([a-z,A-Z,0-9])/)
{
print $2;
print $3;----> #Why no output for $3
print "came";
}
[/code]
Output :
ncame
expected Output:
na1me
If it is na1_me also it should work.
XXXX can contain specialchar,Alp habets or Numerals. Not sure why $2 prints "n" in the below code.
[code=perl]
$var="test.tc__ na1me_1.2008061 6184340025";
if($var=~/(tc)__([a-z,A-Z,0-9])/)
{
print $2;
print $3;----> #Why no output for $3
print "came";
}
[/code]
Output :
ncame
expected Output:
na1me
If it is na1_me also it should work.
Comment