Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: constants in an RE

by BillKSmith (Monsignor)
on May 15, 2023 at 21:30 UTC ( [id://11152198]=note: print w/replies, xml ) Need Help??


in reply to constants in an RE

Using Unicode Character names (Creating Unicode) avoids your problem. It has the further advantage that it eliminates confusion between similar looking characters.
use strict; use warnings; use utf8; use Test::More tests=>1; my $string = "wjzw’xl cowuxze."; my $required = "wjzw\N{APOSTROPHE}xl cowuxze."; #"wjzw'xl cowuxze. +"; $string =~ s/\N{RIGHT SINGLE QUOTATION MARK}/'/ ; is( $string, $required, 'APOSTROPHE' );

UPDATE: Added link

Bill

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11152198]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2026-04-10 08:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.