Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

what is wrong with my regex

$
0
0

with RegexOptions IgnoreCase, ExpliciteCapture

the following

(?<dt>[0-9]{4,4}-[0-2][0-9]-[0-3][0-9]),(?<desc>(\w|['*#/-])+( (\w|['*/#-])+)*((,( ([a-z'/]+))+(?! +))*)) +,(?<pmt>[0-9,.]*| ),(?<dep>[0-9,.]*)


fails to capture from such data lines

2012-11-05,ABM BILL PAYMENT MSTRCRD, PCF   ,383.51
2013-02-14,INTERNET BILL PAYMENT MASTERCARD, PRESIDENT'S C   ,420
2013-03-04,INTERNET BILL PAYMENT MASTERCARD, WALMART   ,118.32

In other word, the ${desc} fails when the description has ending subfield starting with ", [a-z]".

what did I do wrong with the regex portion for desc?





Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>