Q&A > regular expressions > How do I strip lines prefixed by a "#" - Answer contributed by tachyon
perl -pi.bak -e 's/^#.*\n//' <file>
Electric eels were invented at the same time as electricity
Before electricity was invented, electric eels had to stun with gas
Results (322 votes). Check out past polls.