Reputation: 45
Hi right now my regex expression is working as intended. However i wish to specifically exclude items such as how do i update my regex such that it would exclude entries with "-\d*"/ negative quantity? ?
https://regex101.com/r/4EUzLo/1
Upvotes: 2
Views: 65
Reputation: 11018
This should work for you:
'\d+\s*([a-zA-Z].*\w)\s+\d.*'
The '\d+
will only match the positive quantities, and with less steps.
Now, just extract the info from the capture group.
Upvotes: 1