From: Phrogz Date: 2007-08-17T03:54:57+09:00 Subject: Re: grep a csv? On Aug 16, 11:23 am, Kaldrenon wrote: > [...] I'm a little confused about how a pattern > like [^,]+ gets an element, given that (unless I'm mistaken) in a > standard regexp, it would only match on a string that contained a > series of commas that beginning of a line, like ",,," or "abc\n,,". > What's my mistake/confusion here? /,+/ # matches one or more comma characters /[z,]+/ # matches one or more z or comma characters intermixed /[^,]+/ # matches one or more characters that aren't a comma Read up on character classes in regexps.