Thanks for the quick reply. Yes, I've tried that and it doesn't work (the way I'm doing it anyway). I'm guessing because I'm trying to match the beginning of the next line. But /m doesn't seem to help either.
I've tried the following without success: it.gsub!(/[\r\n](?!BOB)/m,'') # removes ALL \n and \r it.gsub!(/[\r\n](?=!BOB)/m,'') #doesn't remove anything it.gsub!(/[\r\n](?=!BOB)/,'') #doesn't remove anything it.gsub!(/[\r\n](?=!^BOB)/,'') #doesn't remove anything Regards, Bryan -----Original Message----- From: "Steven E. Newton" <[EMAIL PROTECTED]> To: Portland Ruby Brigade <[email protected]> Date: Fri, 13 Jan 2006 12:04:14 -0800 Subject: Re: [PDX.rb] Ruby regex question On 1/13/06, Bryan Donovan <[EMAIL PROTECTED]> wrote: > Hi, I'm trying to convert a Perl regex script to Ruby and I'm not sure how to > do one little thing.. > > And of course I've tried some variations of it. I'm just not sure what to > use for the lookahead that the "(?" accomplishes in the Perl script. > (?=re) http://www.rubycentral.com/book/language.html _______________________________________________ PDXRuby mailing list [email protected] IRC: #pdx.rb on irc.freenode.net http://lists.pdxruby.org/mailman/listinfo/pdxruby _______________________________________________ PDXRuby mailing list [email protected] IRC: #pdx.rb on irc.freenode.net http://lists.pdxruby.org/mailman/listinfo/pdxruby
