[EMAIL PROTECTED] wrote:
Hi,
I need to capture whole text after "#" character in each line from  a
file.The below script is not working can any one suggest the correct
thing plz..

Your regexp:

if ($line1 =~ /^#\(.*\)/)

matches any string that:

begins with '#'
followed by a literal '('
followed by zero or more of any character
followed by a literal ')'

From your description above, you want something like:

 /#(.*)$/

which captures anything following a '#' up to the end of the string.

Randy.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to