s{(\\*)(\s+)$}{ if( $1) { if( length( $1) % 2) { $1 . substr( $2, 0, 1) } else { $1 } } else { '' } }e;