Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: Perl treats period as space in string

by BillKSmith (Monsignor)
on Jul 21, 2021 at 18:49 UTC ( #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? | Other CB clients
Other Users?
Others lurking in the Monastery: (1)
As of 2021-12-04 16:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (30 votes). Check out past polls.

    Notices?