Say I have the rowset "123AB", "456CDEF", "789G", "012-HI". How to find all lines that are a number (1 or more) followed by alpha (1 or more) without special characters, where alpha characters are not AB?
To clarify, the regular expression applied to the previous collection should give "456CDEF" and "789G". β123ABβ is ignored because the alpha value is AB, and β012-HIβ is ignored because it contains non-alpha. The regular expression for what I'm looking for, minus the special rules AB, ^[0-9]+[A-Z]+$. It doesnβt matter. I tried several variations of the rule [^ ]without any success, since all the patterns that I came across allowed special characters.
To summarize, how can I match a set of alpha values ββthat do not match a specific subset of alpha values ββusing a single regex pattern?
Note : "123ABC" must also be accepted. Only lines with AB should definitely be ignored.
source
share