.net - Regex: Match character but exclude from pattern -
I have a barcode which I am trying to parse in my document imaging software, through the regular expression of the underlying I believe .net These loan documents have barcodes, which include an account number and sub-account number delimited by a dash (-). The most difficult part of it is that the sub-account number decreases, the account number is that which is full of zero for compensation. Some examples of showing account / sub-account numbers begin at position 11 below and go for 15 characters (including dashes). I need two different regex patterns (one for matching the account number before the dash and one after the other). In all instances, the first 10 zeros is not actually being used in another field. So before matching everything - will work in the short term but if they decide to start using that area, then this will not work. I need some way to parse it, which will give me a 11-25 split position on the dash. I can include a sub account number on the account number and a dash at zero because I have the option of "remove all the main methods of __ character" within the software. I will assign a leading dash to the leading zero and sub account in the account automatically Can we get out of
0000000000123456789-12345133304302014
account = 123456789 sub = 12345
00000000000123456789- 1234133304302014
account = 0123456789 sub = 1234
000000000000123456789-123133304302014
account = 00123456789 sub = 123
0000000000000123456789-12133304302014
account = 000123456789 sub = 12
00000000000000123456789 -1133304302014
account = 0000123456789 sub = 1
edit: The last working regex syntax is as follows: < / p> Account number = [1-9]. (? =. -) Sub-account number = (? & lt; = -). (? = (............ $)) * If you are leading in your groups in the future Also, indexed fields need to be acquired: If you want you can remove zero padding on the account number by matching zero or more leading zeros: (These solutions are the length of the first and last fields.) < / Html>
\ d {10} (\ d +) - (\ d +) \ d {12}
(\ d {10}) (\ d +) - (\ d +) (\ d {12})
(\ d {10}) 0 * ( \ d +) - (\ d +) (\ d {12})
Comments
Post a Comment