|Problems? Is your data what you think it is?|
Challenge - Creative Way To Detect Alpha Charactersby Limbic~Region (Chancellor)
|on Sep 13, 2004 at 17:37 UTC||Need Help??|
Limbic~Region has asked for the wisdom of the Perl Monks concerning the following question:
Today I happened to be in a long boring meeting to discuss the process flow of a project. The presentation was accompanied by some really pitiful code. Pitiful in the sense that the language was not rich, not in the sense that it was bad code. Indeed, there were quite a few creative solutions given the limits of the language (the || operator is used to concatenate strings).
One such problem was to detect if there was any alpha [a-zA-Z] characters in a string where the language didn't support regexes. The equivalent solution using Perl syntax is:
I came up with a few alternatives (walking the string) but they all seemed "wrong" given the current solution.
Cheers - L~R