Using multiple If statements, data validation, and multiple sheets in Google Sheets


I'm working on a spreadsheet and I could really need help. I'm trying to fill cells from a main worksheet with cells from another worksheet in the worksheet.

Currently, I am planning a drop-down menu using data validation in A1 to select the sheet to display and fill it according to what is selected.

In the completed sheets, the code in A2 looks a bit like this

= IF (REGEXMATCH (A1, "SheetA), SheetA! A2, IF (REGEXMATCH (A1," SheetB "), SheetB! A2))

Currently, it works perfectly for the first if statement, but not for the second one. I thought I understood that the if function of the google leaf was formatted like this

= IF (WHAT_TO_CHECK, DO SO IF TRUE, DO IF FALSE)

Does anyone want to help me with that?