I was working with struts validators and need to test a phone number to be digits and starts with a leading 00, I wanna share it here ^00+\d{9,17}$ below is a ruby code snippet: phone_no=”009621111111″ if phone_no =~ /^00+\d{0,9}$/ puts “match” else puts “No match” end a quick explain is ^ start from the beginning [...]
Archive for the ‘Ruby and Ruby On Rails’ Category
Phone Regexp
Posted in code snippet, Ruby and Ruby On Rails, tagged number, phone, regexp, ruby on April 22, 2008 | Leave a Comment »
NetBeans 6.0 IDE First impression
Posted in Java, Markup Languages, Open Source, Ruby and Ruby On Rails, tagged , IDE, infoq, Java, jruby, netbeans, ruby, Ruby on Rails on December 4, 2007 |
Today I installed Netbeans 6 and my first Impression is Wow! I will be posting in-depth look at netbeans-6.0 later. but, what is new on netbeans-6.0? Editor Improvements Smarter code completion Highlights Better Navigation and Inspection Live Templates and Surround Functionality Ruby/JRuby/Ruby on Rails Support Project support including Gems and RSpec Advanced Ruby Editing ActiveRecord [...]
Ruby and Yaml
Posted in Ruby and Ruby On Rails, tagged ruby, yaml, yaml4r on November 12, 2007 |
Yaml (Yet Another markup language) allows developers to serialize and deserialize Object to files and still human readable and editable. in short! I will explain how to load, save, update yaml file using ruby (Yaml4r). a sample source code can be found at the end of this article As always: busy developer walk through: Installation [...]
Installing Ruby On Rails – howto
Posted in Ruby and Ruby On Rails, tagged howto, install, linux, rails, ruby, Ruby and Ruby On Rails on November 12, 2007 |
This is a busy developer tutorial that walk through installing ruby on rails on Linux Machine. get Downloads ready type yum install ruby rdoc irb Rubygems from http://www.rubyonrails.com/down unzip the package. type ruby setup.rb type gem update type gem install rails –include-dependencies choose your lovely database: we will be using mysql for this tutorial; so, [...]