Match Pattern (advanced) "named capture groups"

Hello,

With the basic “Match pattern” module I can use “named capture groups” (?<name>.*), however with the advanced “Match pattern” module this function doesn’t seem to work. Is this correct or is there a way to make it work?

It would be very useful if I could use variables in my regular expression and group my outputs with names.

Now I have a really complex regex because I would like to match 20 different things in 1 module instead of 20 modules.

Thanks
David

Could you share your pattern?

(?<fromTo>FROMTO_\D+IT)|(?<bookingRef>((?<=Booking Reference ../).....))|(?<heenTerug>((?<=HEEN_TERUG_)[A-Z]{2}))|(?<tripcode>([A-Z][A-Z][A-Z]\d\d\d\d2\d[ABC](BE|NL)))|(?<pnrAmadeus>((?<=ReceiptBooking ref)......))|(?<cc>(((?<=Booking Reference )..(?=/))))|(?<from>(((?<=\d\d\D\D\D\d\d\d\d )\D\D\D)))|(?<agent>((?<=Agent )000\d))|(?<bagage>(\d\d\D(?= for Mr))|(\dPC(?= for ))|(\d\d\D(?= for )))|(?<it>((?<=IT)\d+\D\d\d))|(?<returnDate>((?<=Refreshments [A-Z][a-z]+ )\d+ [A-Z][a-z]+.\d\d\d\d))

Hello @Davidof90,
Welcome back.

I would recommend you check every group one by one with multiple inputs.

Sometimes it does not match due to the inputted string not matching as per our expression.

Test with this tool first. https://regex101.com/

I’ve answered multiple questions related to Regular Expressions. It’s not the same but you get more ideas after checking relatable examples.

:+1:

Hello, thanks for your reply, I will check the post.
I just think it’s strange that my expression works in the basic Match pattern module and it doesn’t in the advanced version.