in reply to Regex to add space after punctuation sign
Previous solutions only considered commas and periods, not
other punctuation symbols. Assuming anything that's not a
word character or whitespace is to be considered punctuation,
I would use:
s/(\d[,.]\d)|([^\w\s](?!\s))/$1 || "$2 "/ge;
Abigail
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Regex to add space after punctuation sign
by dda (Friar) on Jan 08, 2004 at 09:52 UTC | |
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