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

Popular posts from this blog

android - net_scheduler holding wakelock -

sql - MySQL : Getting Entries from a many-to-many table -

java - Retrieving data from database using jsp (Hibernate + Spring + Maven) -