interpoliation within regexp
- From: derekbellnersmith@xxxxxxxxx (Derek B. Smith)
- Date: Wed, 27 Sep 2006 13:54:43 -0700 (PDT)
I need to substitute a conversion using chr, but have
failed on multiple attempts. Basically if the first
element contains a # then convert it. Will anyone
advise?
thank you
derek
#if first char is a-z then print it else warn
#chop string into individual characters
my @chars = unpack
("A1" x length($password),$password);
if ($chars[0] =~ /^\D/) {
print "Your new string is:\t",@chars,"\n";
}
else {
print "string starts with number, now converting\n",
@chars, "\n";
substr($chars[0],0,1) =~
s/\Q{$chars[0]}/{chr($chars[0]}\E/;
print @chars;
}
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
.
- Follow-Ups:
- Re: interpoliation within regexp
- From: Derek B. Smith
- Re: interpoliation within regexp
- From: Paul Lalli
- Re: interpoliation within regexp
- Prev by Date: regex help needed
- Next by Date: Re: --compare current date file with previous day
- Previous by thread: regex help needed
- Next by thread: Re: interpoliation within regexp
- Index(es):
Relevant Pages
|