Given the example text you did it appears that you've got "dogs, cats, 4, 8". When you split on "," you'll have spaces at the beginning of your items, hence your anchored regex will fail (e.g. " 4" will not match /^\d+$/). You either need to allow optional spaces there or add them to your split delimiter so they're removed when you split. See perldoc perlre in either case.
In reply to Re: wisdom needed for string matching and array processing
by Fletch
in thread wisdom needed for string matching and array processing
by sierrastar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |