Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Using sprintf in regular expression.

by hippo (Bishop)
on Feb 03, 2022 at 11:23 UTC ( [id://11141099]=note: print w/replies, xml ) Need Help??


in reply to Using sprintf in regular expreession.

rsFalse has given you a good general-purpose answer. However, since you are manipulating dates, you could always use a date module such as the core module Time::Piece.

use strict; use warnings; use Time::Piece; use Test::More tests => 1; my $date = '3-15-1932'; my $want = '1932-03-15'; my $have = Time::Piece->strptime ($date, '%m-%d-%Y')->date; 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://11141099]
help
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found