Regex issue parsing data -


i have following regex :

(\d{7})\s(\d{2}\/\d{2}\/\d{4})\s([a-za-z\-\s\&\#\,\'\.\/\(\)\d]*)\s(\d+[\w\.\/\#]*)\s([a-za-z\/\&\s\d\*\-]*\d{0,1}\.{0,1}\d*[a-za-z]*)\s([a-za-z]*[\d+\.{0,1}\-{0,1}\d]+[a-za-z]*)\s(\d+)\s([a-za-z]*[\d+\.{0,1}\-{0,1}\d]+[a-za-z\s]*)\s([\(\d\,]*\.\d+[\)]*)\s([\(\d\,]*\.\d+[\)]*)\s([\(]*\${1}[\d\.\,\)]*)\s([a-za-z\s\$\.\d\/]*)\s([\(]*\${1}[\d\,]+\.\d{0,2}[\)]*)(\d+) 

the input string being parsed :

6655738 03/31/2017 otter creek country stores, inc richs 72/ 2.5 oz donut jumbo ring 03853 989200 00049800038530 1.00 12.90 $21.21 $2.00 per unit $2.00109830 

the 3rd group returning otter creek country stores, inc richs 72/ whereas want otter creek country stores, inc richs.

could tell me change in regex make work?

your third group is: ([a-za-z\-\s\&\#\,\'\.\/\(\)\d]*) includes numbers , slashes. if don't want these, put them outside group.

but correct solution depends on format of input string. maybe third group has length dependency - regexp needs have different setup.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -