This is more of a Javascript version than RPA software. You can use all Javascript operators inside the IF clause!
So the answer to your question #3 is:
${a}.includes("3 months") && !${a}.includes("5 months")
Test macro (See also includes):
{
"Name": "if OR",
"CreationDate": "2021-6-16",
"Commands": [
{
"Command": "store",
"Target": "3 months 5 months one year",
"Value": "a",
"Description": ""
},
{
"Command": "comment",
"Target": "if_v2 // (${a}.includes(\"3 months\") == true) && (${a}.includes(\"5 months\") == false)",
"Value": "",
"Description": "longer version with == true"
},
{
"Command": "if_v2",
"Target": "${a}.includes(\"3 months\") && !${a}.includes(\"5 months\")",
"Value": "",
"Description": "short version with ! operator"
},
{
"Command": "echo",
"Target": "found!",
"Value": "green",
"Description": ""
},
{
"Command": "else",
"Target": "",
"Value": "",
"Description": ""
},
{
"Command": "echo",
"Target": "NOT found!",
"Value": "blue",
"Description": ""
},
{
"Command": "end",
"Target": "",
"Value": "",
"Description": ""
}
]
}