simple implementation of grep regular_expression