# $special_characters_escaped = backslash( $source_string ); sub backslash ($) { local $_ = ( defined $_[0] ? $_[0] : '' ); # Preserve only printable ASCII characters other than \, ", $, and + @ s/([^\x20\x21\x24\x25-\x39\x41-\x5b\x5d-\x7e])/\\$Backslashed{$1}/ +gs; return $_; }
In reply to Re: Faster way to regex this
by Anonymous Monk
in thread Faster way to regex this
by jar00n
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |