I am facing a problem

I have a dataframe named employer which looks like:

```
employer
------------
wings brand activation i pvt ltd
hofincons infotech &industrial services pvt .ltd
bharat fritz werner bangalore
kludi rak indpvt ltd.

```

Another dataframe which maps the employer name to the category which looks like(call it pincode):

```
Index   Name                                    FINAL_CATEGORY
68781   central board of excise and customs     cat b
68782   c a g hotels pvt ltd                    cat b
68783   avaneetha textiles pvt ltd              cat a
68784   trendy wheels pvt ltd                   cat a+
68785   wings brand activations india pvt ltd   cat b

```

Now I want to emulate something like:

```
pincode[pincode['Compnay Name'].str.contains('wings brand activation i pvt ltd')]

Compnay Name    FINAL_CATEGORY
____________________________________

pincode[pincode['Compnay Name'].str.contains('wings brand activation i pvt')]

Compnay Name    FINAL_CATEGORY
____________________________________

pincode[pincode['Compnay Name'].str.contains('wings brand activation i')]

Compnay Name    FINAL_CATEGORY
____________________________________

pincode[pincode['Compnay Name'].str.contains('wings brand activation')]

        Name                                    FINAL_CATEGORY
68785   wings brand activations india pvt ltd   cat b

```

As you can see, for each string I am reducing the length till last space starting from end of the string and then searching.

The above need to be put in loop with (i think regex). So that for every entry in employer table, it searches for entire range of pincode and figure out the closest match. If nothing then return nan.

Thanks in advance, as the problem is a bit tricky to put in words, please ask for any clarification.