c# exclude regex pattern -
i parsing several text files looking date fields. want find pattern - date: mm/dd/yyyy want exlude pattern - cheque date: mm/dd/yyyy. have working finding first pattern finds second pattern -
string pattern = @"date:\s*(.+?)\r"; using pattern can find combination of dates , not mm/dd/yyyy.
in addition comment, may want use anchor:
string pattern = @"^date:\s*(.+?)\r";
Comments
Post a Comment