I have a list of strings and multiple combinations of conditions to run against them which I want to combine with AND and OR.
Example Rules:
- starts with 12
- exact match 14444 (old value from comments ->12333)
- does not start with 127
The final check would be similar to: ((exact match 14444) OR (starts with 12)) AND (does not start with 127)
(prevent 14444 to be part of a larger string).
Inspired from this post https://stackoverflow.com/a/870506/15272947 ,I got as far as this:
^((?=.*^12)|(?=.*^14444))(?=^(?:(?!^127).)*$).*
It works for start with conditions, but it does not work for exact match. In this case it should match 14444, but not 144445.