Missing letter and numbers

Hello, I don’t know why the month and year got cut off.


Month → (Jan|Feb|Mar|Apr|May|Jun|July|Aug|Sep|Oct|Nov|Dec)
Year → (?<=[A-Za-z]{3} ?)\d{4}

I am using Match 2 of the regular expression output.

missing month and year
Suppose to be:
Nov
2021

Text:
SINGAPORE AIRLINES LIMITED Electronic Ticket Receipt: 618 2433846967 MAUNG/MAUNG NAING MR SQ Booking Reference: 5VIIGP Date of Issue: 13 Nov 2021 Place ot Issue: Singapore Airtines Ticket Office Yangon Flight Details Ticket Number: 618 2433846967 SQ 761 Operated by Singapore Airlines Economy Class (H) From: Yangon (RGN-Mingaladon) Terminal: 1 Depart: Fri, 26 Nov 2021 , 10:25 Status: Confirmed To: Singapore (SIN-Changi) Terminal: - Arrive: Fri, 26 Nov 2021 , 15:10 Stopovers: 0 Baggage Allowance: 30 Kg

@helpplease

(?<=\d{2}\s)[A-Z]+[a-z]+\s\d{4}

You want Month

In for each loop take Assign:Str_month=currentItem.ToString.Split(" “c)(0)
Str_Year=currentItem.ToString.Split(” "c)(1)

Hi @helpplease

Regex Expression: Use this in Find Matching Patterns activity

(?<=Depart\:\s[\w,]+\s[\d]{2}\s)[A-Za-z]+\s+[\d]+

Use this in Assign activity:

System.Text.RegularExpressions.Regex.Match(yourstringinput,"(?<=Depart\:\s[\w,]+\s[\d]{2}\s)[A-Za-z]+\s+[\d]+").Value

This will return a single value.

Hope it helps!!

Is there a way to fix my errors by not changing the expression?

Hi @helpplease ,

We see from your Expression that you are using Month(2) and Year(2) but you would just need to use Month and Year I believe as the values.

@helpplease


I made a little changes to your regex please try this

Give Month(0).toString and Year(0).toString
This will print you the whole output.
I have used the same regex as you have given:

Month → (Jan|Feb|Mar|Apr|May|Jun|July|Aug|Sep|Oct|Nov|Dec)
Year → (?<=[A-Za-z]{3} ?)\d{4}

Output:
image

Regards,

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.