|
say I have some groups of text lines that each group of lines have identical pattern except in the 3rd line there is an optional unique pattern that may or may not be present
Acct1, to be paid [12345upto16Dgit] amout: $587.11 when: 2007-10-11 reference #: 1345 From: some named account[1234..8To14Digt] $687.99
Acct2, to be paid [12345upto16Dgit] amout: $127.11 when: 2009-10-11 reference #: 1345 From: some other named account acct Bal2beDetermined[1234..8To14Digt]
trid with regex options ignore, explicit capture, Single line:
Acct1, to be paid [12345upto16Dgit] amout: $587.11 when: 2007-10-11 reference #: 1345 From: some named account[1234..8To14Digt]
but that missed the one without acctBal however if I remove the last lien of pattern , I will get them all | | fs - new to w7 | aha, got it
(?<AcctName>\r\n[A-Z]{2,40}([',]{0,1})( \w*[,.'-]{0,1}[A-Z]{0,40})*) \[(?<AcctNbr>\d*)\] + .{2,4}amount: \$(?<Amt>{{money}})( {2,6})when: (?<DtPmt>{{yyyy-mm-dd}}) + reference #: (?<RefNbr>\d{4,8}) + .{2,6}From: \w*(\s\w*)* \[\d{8,14}\]( \$(?<FromAcctBal>{{money}}) ){0,1}
instead of (?<AcctName>\r\n[A-Z]{2,40}([',]{0,1})( \w*[,.'-]{0,1}[A-Z]{0,40})*) \[(?<AcctNbr>\d*)\] + .{2,4}amount: \$(?<Amt>{{money}})( {2,6})when: (?<DtPmt>{{yyyy-mm-dd}}) + reference #: (?<RefNbr>\d{4,8}) + .{2,6}From: \w*( \w*){2,10} \[\d{8,14}\]( \$(?<FromAcctBal>{{money}}) ){0,1}
Sorry about the typeo earlier on teh regex pattern. pasted wrong thing w/o being aware - Marked As Answer byfs - new to w7 Tuesday, September 15, 2009 11:27 PM
-
| | fs - new to w7 | aha, got it
(?<AcctName>\r\n[A-Z]{2,40}([',]{0,1})( \w*[,.'-]{0,1}[A-Z]{0,40})*) \[(?<AcctNbr>\d*)\] + .{2,4}amount: \$(?<Amt>{{money}})( {2,6})when: (?<DtPmt>{{yyyy-mm-dd}}) + reference #: (?<RefNbr>\d{4,8}) + .{2,6}From: \w*(\s\w*)* \[\d{8,14}\]( \$(?<FromAcctBal>{{money}}) ){0,1}
instead of (?<AcctName>\r\n[A-Z]{2,40}([',]{0,1})( \w*[,.'-]{0,1}[A-Z]{0,40})*) \[(?<AcctNbr>\d*)\] + .{2,4}amount: \$(?<Amt>{{money}})( {2,6})when: (?<DtPmt>{{yyyy-mm-dd}}) + reference #: (?<RefNbr>\d{4,8}) + .{2,6}From: \w*( \w*){2,10} \[\d{8,14}\]( \$(?<FromAcctBal>{{money}}) ){0,1}
Sorry about the typeo earlier on teh regex pattern. pasted wrong thing w/o being aware - Marked As Answer byfs - new to w7 Tuesday, September 15, 2009 11:27 PM
-
| | fs - new to w7 |
|