#!/usr/local/bin/ruby x=[] x<<'I ([go to]|[like]|[watch]) ([Tokyo]|[sushi]) in London.' x<<'[Go to] home' x<<'([My sun]|[Brother of his father]) ([in the city]|[there]|[over there]) is ([running]|[cute])' p x[0].scan(/\(.*?\)/) p x[1].scan(/\(.*?\)/) p x[2].scan(/\(.*?\)/)