No description was given for what was "tried and got some result but don't look like correct!!" with regard to the Subject inquiry, but in review of the given data and the two predicates from the OP, consider the following; noting, the secondary regex inquiry is apparently already answered and accepted, so is ignored in this response:
with
xmp (id, name, address) as
( values ( 1 , 'xyz' , '1234 abcd ' )
, ( 2 , 'abc' , 'nomans land' )
, ( 3 , 'omg' , '#123 new-york' )
, ( 3 , 'nom' , '$123 &7up' )
)
select id
from xmp
where address NOT LIKE '%abc%'
The above DB2 query should yield the set {(2), (3), (3)}; i.e. include all but the first row. Changing the predicate from address NOT LIKE '%abc%'
to address LIKE '%abc%'
should yield the set {(1)}; i.e. include only the first row. The specification of the predicate in either form address NOT LIKE '%abc%'
or NOT (address LIKE '%abc%')
should yield the same result; they are logically identical requests.