Morning gurus

I'm stumped and need some help with a query join.

I have a table called "Role_Transactions" (its from SAP) and for each "Role", it has multiple "TCode_From" and "TCode_To" values. Example below;
Roles.jpg

I need to match all the "TCodes" from table "Transactions" to the "TCode_From" and "TCode_To" values above, and display both "Role" and "TCode" in the output.
Transactions.jpg

Here's where it gets tricky for me;
- If only "TCode_From" is populated ("TCode_To" is null), then the match is exact between the two tables.
- If there is a value in "TCode_To", that indicates all "TCodes" within the range should be matched.
- Sometimes "TCode_From" and "TCode_To" have a * for a wildcard in them too. Indicating that only the "TCodes" between the two ranges should be matched.

I need "Role" and "TCode" to be output.

Any help would be greatly appreciated!

Cheers!