shamanoff has asked for the wisdom of the Perl Monks concerning the following question:
Hello wise monks, I'm using the following regexp for substituting non-ascii characters with a question mark:
s/[[:^ascii:]]/\?/g;My question is how to substitute all non-ascii characters with their hex-code using regexp. For example, required output would be: "This is string with non-ascii characters, like e2"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: hex in regexp
by jwkrahn (Abbot) on May 22, 2012 at 04:55 UTC | |
|
Re: hex in regexp
by kcott (Archbishop) on May 22, 2012 at 03:47 UTC | |
by shamanoff (Initiate) on May 22, 2012 at 05:04 UTC | |
by kcott (Archbishop) on May 22, 2012 at 12:39 UTC | |
by shamanoff (Initiate) on May 22, 2012 at 21:09 UTC | |
by shamanoff (Initiate) on May 22, 2012 at 21:23 UTC | |
|
Re: hex in regexp
by mbethke (Hermit) on May 22, 2012 at 06:35 UTC | |
|
Re: hex in regexp
by Anonymous Monk on May 22, 2012 at 03:29 UTC | |
by shamanoff (Initiate) on May 22, 2012 at 04:36 UTC | |
by Anonymous Monk on May 22, 2012 at 09:38 UTC | |
|
Re: hex in regexp
by tinita (Parson) on May 22, 2012 at 11:09 UTC |