I have developed a regex in c# which checks a specific pattern in a log file..
string looks something like this :
05-20-2013 15:57:09.334715 [del1-dhp-26330] Read 100 entries from syslog file test
and my regex function is
\d\d-\d\d-\d\d\d\d \d\d:\d\d:\d\d.\d\d\d\d\d\d [@"+agentName+"]"+" Read 100 entries from "+flatFileLogSourceName;
where agent name and flatfilelogsource name will retrieve me the respective values in the string.
but am getting an error says [x-y]
range in reverse order.. which should be because of the agent name as it contains hyphen.
so I am basically looking for a method which could escape hyphen as a string like @
does to \