How to split any string with text as keyword

name: “my name is swarit goyal, i am new in ui path automation”
I want to split name with “swarit”
newtext=name.Split("swarit"c)
or newtext=Split(name,“swarit”)
not working

hello @Swarit_Goyal1
provide like this, name: “my name is swarit goyal, i am new in ui path automation”
newname=name.split(" "c)(3).tostring
split will make array and 3 is index

No i dont want “swarit” in newname

Hi @Swarit_Goyal1 ,

Could you let us know what is the Output that you receive for this expression ?

And what is your Expected Output ?

Currently :
image

Hi @Swarit_Goyal1 ,

Try:

split("my name is swarit goyal, i am new in ui path automation","swarit")

image

Regards,

@Swarit_Goyal1
System.text.regularExpressions.Regex.Split(name, "swarit")

1 Like

I want array like this [“my name is “,” goyal, i am new in ui path automation”]

1 Like

@Swarit_Goyal1 ,

For the Output mentioned, the expression that you have used should have worked.

Do Check by Debugging what is the value in the variable so that you can get a better idea on why it is failing.

System.text.regularExpressions.Regex.Split(name, "swarit")
image

@Swarit_Goyal1

You can try like this as well

Name.Split({"swarit"},Stringsplitoptions.None)

Cheers

It is working Thanks,
Eligibility Response Response Generated: 5/5/2023 8:43:36 am CT
Your Request Eligibility State: Active Coverage
Payer Blue Cross Blue Shield Texas - HCSC (BCBS TX)
Display on Dashboard
Provider ID (NPI) 1790777696 - FAITH COMMUNITY HOSPITAL
Currently Unreviewed
Service Dates 5/4/2023
Last Name DISHMAN Owner: Me (Jorie, Bot20)
First Name WILLIAM
Follow-up Status: Financial Counseling/Self Pay
Middle Name/Init L Front Desk
POS Collection
Member ID
DOB
JEA013073630
2/19/1973
Follow-up Date:
mm/dd/yyyy
Patient Demographics Update Request
Address 501 WALNUT ST, BOWIE, TX 76230-4830
Gender M
Service Coverage Overview
0 User Note(s)
Eligibility Summary: Active Coverage
Plan Name: POINT OF SERVICE MEDICAL

Here is my actual text I want
First Name: WILLIAM
LAST NAME DISHMAN
DOB 02/19/1979
Payer: Blue Cross Blue Shield Texas

I am confused how to get this tried with regex but failed pls help

what do you want to get

Thanks,

Eligibility Response Response Generated: 5/5/2023 8:43:36 am CT
Your Request Eligibility State: Active Coverage
Payer Blue Cross Blue Shield Texas - HCSC (BCBS TX)
Display on Dashboard
Provider ID (NPI) 1790777696 - FAITH COMMUNITY HOSPITAL
Currently Unreviewed
Service Dates 5/4/2023
Last Name DISHMAN Owner: Me (Jorie, Bot20)
First Name WILLIAM
Follow-up Status: Financial Counseling/Self Pay
Middle Name/Init L Front Desk
POS Collection
Member ID
DOB
JEA013073630
2/19/1973
Follow-up Date:
mm/dd/yyyy
Patient Demographics Update Request
Address 501 WALNUT ST, BOWIE, TX 76230-4830
Gender M
Service Coverage Overview
0 User Note(s)
Eligibility Summary: Active Coverage
Plan Name: POINT OF SERVICE MEDICAL

Here is my actual text I want
First Name: WILLIAM
LAST NAME DISHMAN
DOB 02/19/1979
Payer: Blue Cross Blue Shield Texas

I am confused how to get this tried with regex but failed pls help

@Swarit_Goyal1 ,

Your Initial Query was with the Split String, Is this Resolved and do you have a new Query to be asked ?

If so, we ask you to create a new Topic on that so that we can provide separate help on it, as we want to keep each Topic close to the original Query.

1 Like
  1. Extract First Name: Pattern: (?<=First Name: )\w+
  2. Extract Last Name: Pattern: (?<=Last Name )\w+
  3. Extract Date of Birth (DOB): Pattern: (?<=DOB )\d{1,2}/\d{1,2}/\d{2,4}
  4. Extract Payer: Pattern: (?<=Payer: )[\w\s]+

Hope this helps

Thanks for your help
I am getting blank in following
first name
payer
dob

last name is correct

I am getting all fields correct
Please help me to fetch DOB

Sorry for confusion
Extract First Name: Pattern: (?<=First Name )\w+
Extract Date of Birth (DOB): Pattern: \d{1,2}/\d{1,2}/\d{4}(?!Follow-up)
Extract Payer: Pattern: (?<=Payer )[\w\s]+

DOB getting blank