awk regex woth text in each line

The awk regex below produces the current,where
only the matching line are printed. However, I am trying to print all lines in test.txt ,
and if the line matches the first regex the word "good" is printed after the line.
If the line does matches the second regex the word "test" is printed after the line.
If the line does not match the regex the word "bad" is printed after the line.
I'm not sure the best way to accomplish the desired but the logic is:

regex1

1. ensure each line begins with 00-0000
 2. followed by -some number
3. followed by -case insensitive male or female-BBB_xxx
 4. string of all Caps_

regex 2

1. starts with ani digits
 2. followed by - case insensitive test_

test.txt

00-0000-1234-Male-BBB_xxx.txt
11-1111_xxx.txt
00-0000-12345-female-BBB_xxx.txt
000000-Test_xxx.txt
awk '/^[0-9][0-9]-[0-9][0-9][0-9][0-9]-[[:digit:]]+-[Mm]ale|[Ff]emale-[A-Z]_*/' test.txt && awk '/^[[:digit:]]+-[Tt]est_*/'test.txt

current

00-0000-1234-Male-BBB_xxx.txt
00-0000-12345-female-BBB_xxx.txt
000000-Test_xxx.txt

desired

00-0000-1234-Male-BBB_xxx.txt    good
11-1111_xxx.txt    bad
00-0000-12345-female-BBB_xxx.txt    good
000000-Test_xxx.txt    test

Try

awk '
                                                {printf "%s\t", $0
                                                }
                                                
/^00-0000-[0-9]+-[Ff]?e?[Mm]ale-BBB_xxx/        {printf "%s\n", "Good"
                                                 next
                                                }
/^[0-9]+-[Tt][Ee][Ss][Tt]/                      {printf "%s\n", "Test"
                                                 next
                                                }
                                                {printf "%s\n", "Bad"
                                                }
' file
00-0000-1234-Male-BBB_xxx.txt        Good
11-1111_xxx.txt        Bad
00-0000-12345-female-BBB_xxx.txt        Good
000000-Test_xxx.txt        Test

EDIT: Or, even shorter,

awk '
        {V = "Bad"
         if (/^00-0000-[0-9]+-[Ff]?e?[Mm]ale-BBB_xxx/)  V = "Good"
         else if (/^[0-9]+-[Tt][Ee][Ss][Tt]/)           V = "Test"
         printf "%s\t%s\n", $0, V
        }
 ' file

EDIT: Or, even shorter, if you like "conditional assignments / expressions", and one-liners:

awk '{print $0 "\t" ((/^00-0000-[0-9]+-[Ff]?e?[Mm]ale-BBB_xxx/) ? "Good" : (/^[0-9]+-[Tt][Ee][Ss][Tt]/) ? "Test" : "Bad")}' file
1 Like

Thank you very much :).