I might be getting confused with how the forum displayed your examples. If so, my apologies for the unnecessary explanations below.
A TASK in Markdown/Obsidian/dataview is a line that starts: - [ ] and then has some text describing your task. Instead of the space inside the brackets there might be a character there to indicate the task is done instead of not-done: - [x] and then some text.
If your line does not start like that, it is not a task and will not show up in a TASK query no matter what you do.
If your line does start with the task formatting, you can use implicit dataview task fields like text and tags in your query.
Investigating how to answer your question
I like using TABLE queries to investigate what is happening while I am trying to get some other query to work. I usually limit to a small test file or folder while onvestigating so I do not get tons of results but you could also use something like LIMIT 10.
TABLE WITHOUT ID
Tasks.tags,
Tasks.text,
this.a,
contains(Tasks.tags, this.a) AS "a in tags?",
contains(Tasks.text, this.a) AS "a in text?"
FROM "testFileOrFolder"
FLATTEN file.tasks AS "Tasks"
WHERE contains(Tasks.text, this.a)
I would probably start this table without the WHERE line, and then put it in once I have checked that the columns of the table match what I expect.
Does this help with figuring out what your query should look like? Good luck!