wrote:
> For the string abc-12-asdfasdf.inc I want to get abc-12-. I can do
> the opposite (ie. get asdfasdf.inc) with $name ~= s/.*-.*-//g, but
> how do I replace not .*-.*- with blank. Thanks.
E.g.
use warnings; use strict;
my $name = 'abc-12-asdfasdf.inc';
substr($name, 0, 7, '');
print $name;
This code does exactly what you ask for in your example.
Now, if this is not what you meant, then maybe you need to explain the
general principle behind what to delete and what to return. One example is
certainly not enough to deduce a generic pattern.
jue