in reply to Re: 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

Yes, Beginning and End of string count as word boundaries, but only adjacent to a \w character, which ',' is not a member of.
  • Comment on Re: Re: Re: regex: only want [a-zA-Z] and comma chars in a string

Replies are listed 'Best First'.
Re: Re: Re: Re: regex: only want [a-zA-Z] and comma chars in a string
by davido (Cardinal) on Oct 12, 2003 at 18:36 UTC
    Ack! You got me. haha. You are, of course, correct. \b,\b works because there is no word boundry at the junction of comma and end of string, or comma and beginning of string. It also works because there is no word boundry at the junction of two proximate commas. Good solution, and kudos for coming up with the briefest one so far. ;)


    Dave


    "If I had my life to do over again, I'd be a plumber." -- Albert Einstein