Hi Madhu.

You have two different questions here!

Madhu Reddy wrote:
> Hi,
>    I want to find and replace string with particular
> pattern
>
>
> my $str =  "                 13  A.MFDF_FEEDER_ET";
> $str =~ s/\s+//g;
>
> here i want to replace string that end with "_ET" with
> null....

To replace the string of non-space characters ending in '_EF'
with nothing, you do this:

  $str =~ s/\S+_ET//;

which leaves you with

  "                 13  "
> basically i wanto get result 13 in $str.
>
> how to do this?

It depends on what '13' looks like in general in the strings
you're processing. If it's always the first non-space thing
after the start of the line then

  $str =~ /(\w+)/;
  print $1, "\n";

prints '13'. If it's more complex than that then ask us again.

HTH,

Rob




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to