Syntactic Confectionery Delight | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
unless (($key =~ /^,|,,|,$/)) Cute, testing for the negative is much more readable here ... but probably something I wouldn't have tried. You need to check for the characters being in the valid class though (and I'd also put brackets around the anchors) so that would make it...
Which isn't quite as nice anymore :(. So I'd probably still use the "obvious" non-negative...
Or if I was feeling really special, I might even do...
...which is slightly more readable IMO. update (broquaint): changed <pre> to <code> tags In reply to Re: Re: regex: only want [a-zA-Z] and comma chars in a string
by nevyn
|
|