Regular expression to match output that doesn't contain a word

I have a play that runs against several switches and returns the output of:

  • name: show int desc
    ios_command:
    commands:
  • “sh interfaces description | inc {{ mac_addr }}”
    register: printout

Is there a way to exclude results from switches that return results containing the string “UPLINK”?

Hopefully someone can point me in the right direction, I’ve been playing with regex_findall in my testing trying to exclude any results that contain UPLINK using:
^((?!UPLINK).)*$

I get allot of errors such as:
unexpected templating type error or template error while templating string: unexpected

IE: don’t display the results from the results from switches like these examples:

ok: [switch20] => {

“printout”: {

“changed”: false,

“failed”: false,

“stdout”: [

“Gi1/0/25 up up UPLINK”

],

“stdout_lines”: [

[

“Gi1/0/25 up up UPLINK”

so hopefully it would only display this switch:

ok: [switch9] => {

“printout”: {

“changed”: false,

“failed”: false,

“stdout”: [

“Gi1/0/42 up up SEG 12 “

],

I’m a bit rusty on the IOS constructs but given that you are already piping things using “inc” (which is short for “include”), there is also “exclude”, maybe adding that works?