How do I skip lines that start with #
Posted: Tue Jul 14, 2015 10:26 pm
I have a config file that I need to parse out. I am trying to write a very simple expression to match the variable on each line that does NOT start with a # (comment) character.
Here is a sample text from that config file:
# --------------------------
# some comments go here...
# -------------------------
#SSCOutputGenerationSchedule = 2015-07-03:21:00 5,2015-07-03:22:30,2015-07-04:14:00,2015-07-04:19:00
SSCOutputGenerationSchedule = 2015-08-05:14:00,2015-08-05:19:00,2015-08-10:15:30,2015-08-16:10:00
I want to match the SSCOutputGenerationSchedule variable on the last line and skip all lines that start with #. Here is what I've tried:
^(?!#)(\([A-Za-z]*\))
I found that expression on-line somewhere. It uses a negative look-back feature, which I thought would give me what I need, but it doesn't seem to work in the regexpal.comtool that I'm using for testing. Neither does regex101.com tool so I think the expression needs work.
Any tips would be appreciated.
Here is a sample text from that config file:
# --------------------------
# some comments go here...
# -------------------------
#SSCOutputGenerationSchedule = 2015-07-03:21:00 5,2015-07-03:22:30,2015-07-04:14:00,2015-07-04:19:00
SSCOutputGenerationSchedule = 2015-08-05:14:00,2015-08-05:19:00,2015-08-10:15:30,2015-08-16:10:00
I want to match the SSCOutputGenerationSchedule variable on the last line and skip all lines that start with #. Here is what I've tried:
^(?!#)(\([A-Za-z]*\))
I found that expression on-line somewhere. It uses a negative look-back feature, which I thought would give me what I need, but it doesn't seem to work in the regexpal.comtool that I'm using for testing. Neither does regex101.com tool so I think the expression needs work.
Any tips would be appreciated.