in reply to Re: Regex to add space after punctuation sign
in thread Regex to add space after punctuation sign
Thank you, Abigail. Can you please explain how does the replacement part of your expression work? If I understand correctly, /e evaluates $1 || "$2 " -- that way if $1 is not empty, it should not add second part?
P.S. I added end-of-line processings as was suggested by aragorn:
--dda
s/(\d[,.]\d)|([^\w\s](?!\s)(?!$))/$1 || "$2 "/ge;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Regex to add space after punctuation sign
by Abigail-II (Bishop) on Jan 08, 2004 at 09:58 UTC | |
by dda (Friar) on Jan 08, 2004 at 10:07 UTC |
In Section
Seekers of Perl Wisdom