Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Breaking symmetry with a regex

by hippo (Bishop)
on Apr 13, 2021 at 22:57 UTC ( [id://11131231]=note: print w/replies, xml ) Need Help??


in reply to Breaking symmetry with a regex

Your string as described ends with a colon. All you need is chop - no need for regex:

use strict; use warnings; use Test::More tests => 1; my $have = 'a:b:'; my $want = 'a:b'; chop $have; is $have, $want;

🦛

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2024-04-23 10:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found