Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: Perl treats period as space in string

by BillKSmith (Monsignor)
on Jul 21, 2021 at 18:49 UTC ( [id://11135272]=note: print w/replies, xml ) Need Help??


in reply to Re: Perl treats period as space in string
in thread Perl treats period as space in string

You can solve this problem with qr in Regexp Quote Like Operators.
use strict; use warnings; use Test::More tests => 2; my $phrase = qr/club\.market/; unlike( 'club market', $phrase, 'not match space' ); like( 'club.market', $phrase, 'match period' );

RESULT,

1..2 ok 1 - not match space ok 2 - match period
Bill

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-04-23 21:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found