----- Original Message ----- From: "Moon, John" <[EMAIL PROTECTED]>
To: "'Tham, Philip'" <[EMAIL PROTECTED]>
Cc: <beginners@perl.org>
Sent: Tuesday, May 10, 2005 4:55 PM
Subject: RE: Help with substitution
$string =~ s/(\d\w{3})(.*)/$2/;To: 'Tham, Philip' Subject: RE: Help with substitution
Subject: Help with substitution
Hi
I have a string which reoccuring patterns
1abc2abc3abc4abc567
How do I remove everything before the 1st occrence of abc to get the result 2abc3abc4abc567
s/^.*abc//
Gives me 567
Thanks in advance.
perl -e '$a="1abc2abc3abc4abc567"; $a=~ s/^.*?abc(.+)$/$1/; print "$a\n";'
Thanks Wags - If I recall correctly...
jwm
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>