in reply to Re: regex: only want [a-zA-Z] and comma chars in a string
in thread regex: only want [a-zA-Z] and comma chars in a string
unless($tax_collection ~= /^([a-zA-Z]+|\b,\b)+$/) {...
No, that's not going to work because it allows the comma to appear at the beginning and/or end of the string, which doesn't meet the original post's spec. Beginning and End of string count as word boundries, so your method fails.
Update: Now it's a matter of public record: I made a simple mistake in intrepreting Anonymous Monk's regexp. (S)He is correct in his assertion. The method works.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: regex: only want [a-zA-Z] and comma chars in a string
by Anonymous Monk on Oct 12, 2003 at 18:34 UTC | |
by davido (Cardinal) on Oct 12, 2003 at 18:36 UTC |