Q&A > regular expressions > How do I strip lines prefixed by a "#" contributed by Anonymous Monk
@code_lines = grep !/^#/, @all_lines;
The above code is taken directly from the Camel head book.
Frying pan on the stove
Results (348 votes). Check out past polls.