Is a union of multiple similar relevance statements possible?

I am trying to parse the /etc/shadow file on multiple Linux machines, and am looking to first pull all the names of the users (the first column) where the line contains “:*:”, “:!:” and “:!!:” (column 2). And secondly I am looking to pull the names of those users without those values in column 2. I am able to do the first it with one statement for a single value using:

substrings before ":!!:" of lines containing ":!!:" of file "/etc/shadow"

The issue is tying all three together:

substrings before ":!!:" of lines containing ":!!:" of file "/etc/shadow" 
substrings before ":!:" of lines containing ":!:" of file "/etc/shadow" 
substrings before ":*:" of lines containing ":*:" of file "/etc/shadow" 

I’ve tried union, intersection, concatenation and nothing works. Has anyone got any suggestion?

Thanks.

Something like that

(preceding text of first ":!!:" of it) of lines whose (it contains ":!!:")of file "/etc/shadow"; (preceding text of first ":!:" of it) of lines whose (it contains ":!:")of file "/etc/shadow";(preceding text of first "::" of it) of lines whose (it contains "::")of file "/etc/shadow"

Thanks - I tested and implemented the above successfully, and with help from the Relevance documentation, I was able to use set subtraction to pull the list of all valid users. Mission Accomplished!

hm… not sure if it will do always correct things
I’m guessing you are checking password field in shadow, the most accurate way is regex

as result you have pare (user_name, password_hash) - after you could filter out it as you want

(item 0 of it, item 1 of it) of ((parenthesized part 1 of it as string, parenthesized part 2 of it as string) of (matches (regex "^([^:]*):([^:]*):([^:]*):([^:]*):([^:]*):([^:]*):([^:]*):([^:]*):([^:]*)") of lines of file "/etc/shadow")) whose (item 1 of it !="!"  and item 1 of it != "!!" and  item 1 of it !="")

You could combine it like this:

( preceding text of first ":!!:" of it | preceding text of first ":!:" of it | preceding text of first ":*:" of it) of lines whose(it contains ":!!:" OR it contains ":!:" OR it contains ":*:") of files "/etc/shadow"

This should also be equivalent:

( preceding text of first ":!!:" of it | preceding text of first ":!:" of it | preceding text of first ":*:" of it) of (lines containing ":!!:" of it; lines containing ":!:" of it; lines containing ":*:" of it) of files "/etc/shadow"

I haven’t tested it, but either of these options should be more efficient than just putting the 3 statements together.