Matching genes in string in Python
For character handling at such micro level the query will end up being clunky with high response time — if you're lucky to write a working one. 
This's more of a script kind of operation.
I'm trying to match text strings (gene names) in a column from one file to text strings in a column of another, in order to create a subset the second. 
For simplicity, the first will look more or less like this:
hits = ["IL1", "NRC31", "AR", etc.]
However, the column of interest in the second df looks like this:
68           NFKBIL1;NFKBIL1;ATP6V1G2;NFKBIL1;NFKBIL1;NFKBI
236                                                  BARHL2
272                                             ARPC2;ARPC2
324                                                  MARCH5
...
11302        NFKBIL1;NFKBIL1;ATP6V1G2;NFKBIL1;NFKBIL1;NFKBI
426033                                        ABC1;IL1;XYZ2
...
425700                                                IL17D
426295                                              RAB3IL1
426474                                        IL15RA;IL15RA
I came up with:
df2[df2.UCSC_RefGene_Name.str.contains('|'.join(hits), na=False)]
But I need to match the gene IL1 if it falls in the middle of the string (e.g.row 426033 above) but not similar genes (e.g. row 426295 above). 
How do I use regular expressions to say:
"Match the any of the strings in hits when they have ';' or 'a blankspace' at either the beginning or the end of the gene name, but not when they have other letters or numbers on either side (which indicate a different gene with a similar name)? 
I also need to exclude any rows with NA in dataframe 2.
Yes, I know there are regex syntax documents, but there are too many moving parts here for me to make sense of them.