in reply to Re: How to replace spaces with different chars?
in thread How to replace spaces with different chars?

s{ ( [ ] ) | ( [^\w ] ) }{ defined( $1 ) ? $special_chars_re_class : "\\$2" }egr;

I think this needs the /x modifier to work as advertised.


Give a man a fish:  <%-{-{-{-<

Replies are listed 'Best First'.
Re^3: How to replace spaces with different chars?
by ikegami (Patriarch) on Jul 07, 2022 at 19:13 UTC

    Oops, fixed.