I want to find a particular string (word) from a sentence.
Given string:
"In a given health plan your Plan Name: Medical and Plan Type: PPO whose effective date: 2019-01-01 and coverage value $100 and $200".
- if I pass
"Plan Name:"
then my output would be "Medical"
.
- if I pass
"Plan Type:"
then my output would be "PPO"
.
- if I pass
"effective date:"
then my output would be "2019-01-01"
.
- if I pass
"coverage value"
then in this case I need two value.
Min value "$100"
and MAX value "$200"
.
Similarly I need email address from a given sentence. There could be scenario where I just need to pic a date, email or a numeric value from a given sentence. In this case I do not have any previous value to match.
I need a regular expression logic that covers all above requirements.