in reply to Using 'ord' in a regular expression for substitution
You don't. Try instead:
# Build a regular expression: my $regex = qr/ord(226)/i; # Use it to alter $string: $string =~ s/$regex/'/g;
Having said that, I doubt you want to use ord, as it converts a character into a number. I suspect you want chr which turns the number into a character...
Update: Ignore this stupid post, please.
...roboticus
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using 'ord' in a regular expression for substitution
by JavaFan (Canon) on Aug 25, 2010 at 15:24 UTC |