in reply to Re^3: converting smart quotes
in thread converting smart quotes
In a regular expression, the "\xNN" escape always takes exactly two hexadecimal digits, so can only match characters in the range "\x00" to "\xFF". Adding braces like "\x{1FFFFF}" allows an arbitrary number of hexadecimal digits (presumably limited only by your architecture's integer size). perlre should explain it - search it for "long hex char".
Escapes like this also work in interpolated strings. e.g.
perl -Mutf8::all -E'say qq(\x{263a})'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: converting smart quotes
by slugger415 (Monk) on Mar 20, 2012 at 14:49 UTC | |
|
Re^5: converting smart quotes
by slugger415 (Monk) on Mar 20, 2012 at 14:30 UTC | |
by tobyink (Canon) on Mar 20, 2012 at 15:27 UTC |