
KevinR
Veteran

Dec 26, 2008, 6:27 AM
Views: 4192
|
|
Re: [jwhit61] Track. Title format for audio files
|
|
|
Just a quick look through your code I spotted these lines:
$NewText =~ tr/[A-Z]/[a-z]/; #Make everything lowercase $NewText =~ s/\b([a-z]+)\B/ucfirst(lc($1))/eg; #Boundary ends with a Number In the first line the square brackets are not doing anything. The square brackets do not make a character class when using tr///. tr/// is not a regular expression like s/// and m// are. Leaving them in is not hurting anything but they are being treated as literal characters and not as a character class. But to make everything lower-case, use the lc() function: $text = lc($text); In the second line, it looks like you would be better using \d instead of \B as the end of pattern anchor. \d is digits 0-9. -------------------------------------------------
(This post was edited by KevinR on Dec 26, 2008, 6:29 AM)
|