I am trying to extract some information from a text document. I have converted this text document into a data frame using `pdftext().` Now I would like to extract the information I am after. Below is the code to create a dataframe like mine:

```
text <- data.frame(page = c(1,1,2,3), sen = c(1,2,1,1), text = c("Dear Mr case 1","the value of my property is £500,000.00 and it was built in 1980", 
                                                             "The protected percentage is 0% for 2 years", "The interest rate is fixed for 2 years at 4.8%"))

```

From the above dataframe, I need to extract the following:

1: Gender of the person. In this case it would be Male (looking at Mr)

2: The number that represents the property value. in this case would be £500,000.00.

3: The protected percentage value, which in our case would be 0%.

4: The interest rate value and in our case it is 4.8%.

Ideally I would like to output a data frame like below:

[![enter image description here](https://i.stack.imgur.com/p33kH.png)](https://i.stack.imgur.com/p33kH.png)

Even if I can extract these pieces of information separately, It is still good enough. I probably can use a regular expression, tell it to find a pattern like 'Protected Percentage' and then give me the number that appears right after it finds this pattern. Any help would be greatly appreciated.