ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> ruby-talk
ruby-talk
Re: Learning Ruby
by Cristiano Marchettini other posts by this author
Oct 31 2006 3:10AM messages near this date
Re: Learning Ruby | Re: Learning Ruby
Hi,

On Tue, 2006-10-31 at 20:00 +0900, Peter Szinek wrote:
>  
>  Could you provide the examples you have tried? I did not really get you, 
>  as for me:
>  
>  irb(main):003:0> "foobar" =~ /foo/
>  => 0
>  irb(main):004:0> "foobar" =~ /fo+/
>  => 0
>  your example works. Please send the code snippets which did not work for 
>  you.

I did not explain me too well.
This code works for me too. I was referring to the User Guide example.
Here is the code that doesn't work for me:

st = "\033[7m"
en = "\033[m"

while TRUE
  print "str>  "
  STDOUT.flush
  str = gets
  break if not str
  str.chop!
  print "pat>  "
  STDOUT.flush
  re = gets
  break if not re
  re.chop!
  str.gsub! re, "#{st}\\&#{en}"
  print str, "\n"
end
print "\n"

Thanks again,
Cristiano
Thread:
Urzahil
Peter Szinek
Cristiano Marchettini
Michael Fellinger
Vincent Fourmond

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved