On Sat, Nov 11, 2023 at 10:00:12PM +0100, Emanuel Berg wrote: > Edgar Lux wrote: > > > Hello. I am trying to get this regular expression: > > > > "[^a][^b]" > > > > in an easier way. I thought that I could do > > > > (rx (not (seq "a" "b"))) > > > > but that got me > > > > Debugger entered--Lisp error: (error "Illegal argument > > to rx ‘not’: (seq \"a\" \"b\")") > > > > The error is very clear, but I would like to know if there > > is a smart way of achieving the same without having to type: > > > > (rx (seq (not "a") (not "b"))) > > > > which produces > > > > "[^a][^b]" > > (rx (not (any "a" "b"))) > > "[^ab]" (string-match "[^a][^b]" "ba") => 0 ; note: 0 means it found a match at pos 0 (string-match "[^ab]" "ba") => nil No. Cheers -- t