I have a line of text...say:
"My.File, your.File, another.file, SOMEBODY.file"
I want to "loop" thru the line, grabbing each filename (in this example) that contains an uppercase letter, and do something with that word.
For example:
As you can see, this would result in an infinite loop because it's always grabbing the same filename. HOWEVER, if I am able to somehow specify that I only want to match (\w+\.\w+) where there is an uppercase letter in it...all is good.
Any ideas?
"My.File, your.File, another.file, SOMEBODY.file"
I want to "loop" thru the line, grabbing each filename (in this example) that contains an uppercase letter, and do something with that word.
For example:
Code:
$changed = 1;
while ($changed) {
$changed = 0;
if (/(\w+\.\w+)/) {
$text = $1;
print "$text\n";
$lctext = lc($text);
s/$text/$lctext/g;
$changed = 1;
}
}
As you can see, this would result in an infinite loop because it's always grabbing the same filename. HOWEVER, if I am able to somehow specify that I only want to match (\w+\.\w+) where there is an uppercase letter in it...all is good.
Any ideas?