Home:ALL Converter>Need Regular Expression logic to find string

Need Regular Expression logic to find string

Ask Time:2019-06-28T16:30:57         Author:Udai Mathur

Json Formatter

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".

  1. if I pass "Plan Name:" then my output would be "Medical".
  2. if I pass "Plan Type:" then my output would be "PPO".
  3. if I pass "effective date:" then my output would be "2019-01-01".
  4. 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.

Author:Udai Mathur,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/56803499/need-regular-expression-logic-to-find-string
yy