From: Robert Klemme Date: 2010-10-12T22:17:17+09:00 Subject: Re: Help with regexp's On Tue, Oct 12, 2010 at 3:11 PM, Thiago Massa wrote: > Is there any way to a regexp allow any character but the comma? Use a negated character class [^,] or use negated matching !~. > My regexp is getting ugly like /(\x2E|\x3A|\x27|\x28|\x29|\x2D|\x21|\x2B)*/ > and so on(i ommited the real one for the love of god) > > I'm even thinking about implementing it myself like > > if not comma >  pass > else >  not_pass > end > > isn't there a way to extend the way ruby deals with regexp and make > something like "/everythingbutnotcomma" mean what i want? What exactly are you trying to achieve with matching? Do you want to make sure there is no comma in a sequence or do you want to do substitutions? > I'm sorry of my lack of knowledge about regexps... I'm trying to really > learn it once and for all. I highly recommend "Mastering Regular Expressions". Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/