in reply to Simple formatting question for credit card number
I hope that wasn't your real credit card number.#!/usr/bin/perl -w use strict; my $number = '4744760012394122'; if ($number =~ /^(\d{4})(\d{4})(\d{4})(\d{4})$/) { $number = "$1 $2 $3 $4"; } else { print "Unable to convert $number\n"; }
Cheers - L~R
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Simple formatting question for credit card number
by liz (Monsignor) on Aug 12, 2003 at 20:18 UTC | |
by tedrek (Pilgrim) on Aug 12, 2003 at 20:25 UTC |