Keep It Simple, Stupid | |
PerlMonks |
simpler regexby rsiedl (Friar) |
on May 10, 2007 at 07:48 UTC ( [id://614556]=perlquestion: print w/replies, xml ) | Need Help?? |
rsiedl has asked for the wisdom of the Perl Monks concerning the following question:
hi monks, i'm trying to write a regex to add a period after any single character in a string. i.e. "Bob J Smith" becomes "Bob J. Smith", "A Jones" becomes "A. Jones", etc. i've managed this with: but was trying to get it down to one line. can anyone tell me why this is not working: "A A Jones" comes out as "A. A Jones" rather than "A. A. Jones". cheers, rsiedl
Back to
Seekers of Perl Wisdom
|
|