Hi all, I have a file that I want to open as a file handle and only retrieve lines that don't have a hash mark, an asterisk, or a line that looks like this:
# ****************************
I have tried /[^#*]/ but it doesn't work. Anyone have any tips?
If your convention is that comment lines always start with a # character in the first poition on the line, then the fact that you have a whole load of ***** after it is just complicating it.
To ignore any line that begins with a # you can put this line at the beginning of the inside of the loop that reads the file:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.