Hi Henning,

$catch = $1 if ($string =~ /.*(E)\d*\b/);

you can use this to test it:
$catch = $1 if ($string =~ /.*(E\d*)\b/);

-- 
Regards,
Akhthar Parvez K
http://www.sysadminguide.com/
UNIX is basically a simple operating system, but you have to be a genius to 
understand the simplicity - Dennis Ritchie

On Tuesday 02 Nov 2010, Larsen, Henning Engelbrecht wrote:
> I want to search a string for patterns but starting the search from the
> _end_ instead of from the beginning, using a regular expression.
> 
> For instance I want to find the last 'E' in the string
> 
>  
> 
> ...looong string possibly with many E's.......E.....no capital e'
> here...3456
> 
>  
> 
> The regular expression E$ will match an 'E' but only if it is at the
> very end. That's not the (only) match I want - also the E in '...E123'
> should match.
> 
>  
> 
> One obvious solution is to reverse the string and use normal methods to
> find the first 'E', but there must be smarter ways, as this appears to
> be a relatively common problem to solve. Isn't it?
> 
>  
> 
> Any hints are welcome.
> 
> Thanks from
> 
> henning
> 
> 



-- 
Regards,
Akhthar Parvez K
http://www.sysadminguide.com/
UNIX is basically a simple operating system, but you have to be a genius to 
understand the simplicity - Dennis Ritchie

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to