lib/sugar-high/regexp.rb in sugar-high-0.1.8 vs lib/sugar-high/regexp.rb in sugar-high-0.2.0
- old
+ new
@@ -6,6 +6,13 @@
class Regexp
def to_regexp
self
end
+end
+
+class Array
+ def grep_it expr
+ return self if !expr
+ self.grep(expr.to_regexp)
+ end
end
\ No newline at end of file