You can use colorize to color the characters output by the terminal.
require 'colorize' def assert_equal(expected, result) if expected == result puts 'true'.cyan else puts 'false'.magenta end end assert_equal(1, 1)
Then, true is displayed in cyan and false is displayed in magenta.
Rubular (http://rubular.com) is a Ruby-based regular expression editor. You can try it as a test when writing a regular expression.
For example, as test string
In the regular expression part
If you enter
Only can be extracted.
I found it convenient to be able to check before actually writing in the program.