in reply to [perlre] 4-digit hex code in regexp? How to specify?

According to the docs the following should allow 4 byte Unicode defs:
s/([\x{1F24}])/$delimiter/gm;

Update: Sorry did not spot that this had been dismissed. How about the clunky

{ my($temp); $temp1 = "\x{0024}"; $temp2 = "\x{1F45}"; s/([$temp1,$temp2])/$delimiter/gm; }

Replies are listed 'Best First'.
Re^2: [perlre] 4-digit hex code in regexp? How to specify?
by Aristotle (Chancellor) on Nov 15, 2002 at 16:41 UTC
    Except you don't want the comma in the character class. And why use two variables?
    { my $temp = "\x{0024}\x{1F45}"; s/([$temp])/$delimiter/gm; }
    Which if often used might be better written as
    # somewhere in init code my $descriptive_charclass_name = do { my $wide = "\x{0024}\x{1F45}"; qr/[$widechars]/; }; # ... later s/($descriptive_charclass_name)/$delimiter/gm;

    Makeshifts last the longest.