Search complicated strings on file

Can someone help me? I been figuring out how I can search and extract a complicated search string from a file. The whole string is delimited by a period. And the file where I'm searching is composed of differnt string such as that. For example, I have this search string:

and I have a file containing:

Now I need four outputs since my search string is divided into four strings delimited by period:

Your strings are not that complicated!

/Users/scott/scripts/tmp $ awk '/^(mai|sim)/' file1
mai.lim.13_60.colorValidationResponse
sim.nam.13_60.colorValidationResponse
sim.lim.12_80.colorValidationResponse
sim.lim.13_60.colorValidationRequest
sim.lim.14_90.colorValidationResponse
sim.nam.13_60.colorValidationResponse
/Users/scott/scripts/tmp $ grep -E 'mai|sim' file1     
mai.lim.13_60.colorValidationResponse
sim.nam.13_60.colorValidationResponse
sim.lim.12_80.colorValidationResponse
sim.lim.13_60.colorValidationRequest
sim.lim.14_90.colorValidationResponse
sim.nam.13_60.colorValidationResponse

gets all the strings you need. What you mean by "1st output", "2nd output", etc. could use some explaining :smiley:

Assuming you're looking for a match of all unique pairs of fields 1 and 2 with their unique entries of field 4:

one_two=$(cut -d'.' -f1,2 <file.txt |sort -u )
foe_rrr=$(cut -d'.' -f4   <file.txt |sort -u |tr ' ' '|' )

for i in $one_two ;do print "\nMatch [$i]: " ;grep $i file.txt |egrep "$foe_rrr" ;done

Hi.

Judging from the output, I'm guessing that the search is intended to be an "OR":

sim.lim.13_60.colorValidationResponse

means

sim OR lim OR 13_60 OR colorValidationResponse 

possibly restricted to the content of the fields in order. If so, then there are a number of methods, if not then choose from the suggestions so far, or explain with more detail ... cheers, drl