Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re^2: What is missing from the beginning of this string?by japhy (Canon) |
on Oct 08, 2010 at 13:13 UTC ( [id://864201]=note: print w/replies, xml ) | Need Help?? |
Your regex solution s/^(.*?)(\w+\.)/$2/ should work perfectly for this.
The mad scientist in me, though, is still wondering if there's a way to do this sort of thing abstractly: to provide a prefix for a string where the prefix may be only partially present. I'll think about it later. It's Friday. Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker Nos autem praedicamus Christum crucifixum (1 Cor. 1:23) - The Cross Reference (My Blog)
In Section
Seekers of Perl Wisdom
|
|