Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Remove digits from a string and add timestamp to the result

by sen (Hermit)
on Jan 02, 2013 at 11:43 UTC ( #1011251=note: print w/replies, xml ) Need Help??


in reply to Remove digits from a string and add timestamp to the result

Hi Sunil, If i understand your requirement correclty,

try this, Customer_."$timestmp"._100

Update:

$a=Customer100; $b=20130201; $a=~ /(.*?)(\d+)/; $a= $1."_".$b."_".$2; print $a;
Update1:
$a=~ s/(.*?)(\d+)/$1\_$b\_$2/;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1011251]
help
Chatterbox?
[Discipulus]: i know, i know..
[shmem]: man perlfunc |perl -nle '$ok++ if /Alphabetical Listing of Perl Functions/;if($ok ){$s{$1}++if /^ (\w+)/}}{for(keys %s){$f="prototype \\\&CORE::$_"; eval"$f"||delete $CORE::{$_}}print for sort keys%CORE::'
[shmem]: well, there are some builtins which don't have a prototype...
[Discipulus]: eh eh.. i was looking in toke.c but dunno if is already used
[shmem]: oh the whitespace in the regex got condensed, meh
[shmem]: should be /^ {7}(\w+)/ or such
[shmem]: ...at least for my perldoc on Linux debian 8
[Discipulus]: mmh.. at themomemt i just an old 5.8 and outputs just GLOBAL::

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2017-05-23 10:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?