Untested code rocks. :) dvergin is absolutely correct, this code will not work. I will leave it as is, to serve as a warning to others about posting without testing. Thanks for the lesson, dvergin. :)
And now back to our regular show...
</update>
I would try something like:
Which should insert a space in front of each capital letter, except if it is at the start of the string (the dot makes sure there must be at least one letter of any kind in front of the matched uppercase letter).$agent =~ s/.([A-Z])/ $1/g;
If you don't want to insert when there are capital letters standing together, like in CIA => C I A, you could try something like:
Which should make sure it matches an uppercase letter, that is preceded with anything but an uppercase letter.$agent =~ s/[^A-Z]([A-Z])/ $1/g;
Hope I understood the question correctly. :)
In reply to Re: Search for a character in CAPS
by Dog and Pony
in thread Search for a character in CAPS
by c_lhee
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |