s/^\D*\d+// # 'first few digits'
Even if this interpretation is correct (and I agree with erix that it’s unlikely), there is no warrant in the OP to remove the non-digit prefix. So the regex would need to be: s/^(\D*)\d+/$1/. For example:
23:21 >perl -wE "$f = 'xyz20130101Customer100.imp'; $f =~ s/^(\D*)\d+/ +$1/; say $f;" xyzCustomer100.imp 23:22 >
Update (2nd January, 2013):
Thank-you Anonymous Monk for the improvement below using \K: shorter and “much more efficient”, according to perlre. I’ve learned something useful!
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re^4: Removing digits from a string
by Athanasius
in thread Removing digits from a string
by suneel.reddy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |