2012/9/11 Sybren Kooistra <[email protected]> > Works like a charm :) > > Any idea how I can save boolean (in some cases I do not want the content > of a node, but I only want to know IF a certain word IS or IS NOT part > of the html) > > -- > Posted via http://www.ruby-forum.com/. > > You can use Regex for that. Find some ruby regex tutorial on google. Example tutorial http://www.tutorialspoint.com/ruby/ruby_regular_expressions.htm Here is example code from that tutorial:
#!/usr/bin/ruby line1 = "Cats are smarter than dogs"; line2 = "Dogs also like meat"; if ( line1 =~ /Cats(.*)/ ) puts "Line1 starts with Cats" end if ( line2 =~ /Cats(.*)/ ) puts "Line2 starts with Dogs" end -- You received this message because you are subscribed to the Google Groups ruby-talk-google group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at https://groups.google.com/d/forum/ruby-talk-google?hl=en
