I have an issue with a regex. here below details:
I have the following basis chain:
N_aa-AAAA-140143-AAAAAA_1---
The regex i'm using:
^N_([A-Za-z]+)-([A-Za-z]+)-([A-Za-z0-9]+)-([A-Za-z0-9_-éÉ\s]+)---
The result i have for the basis chain:
group1: aa.
group2: AAAA.
group3: 140143.
group4: AAAAAA_1.
But sometimes there is some missing element between "--" for the group3:
N_AA-AA--AAAA_1---
The result i would like in this case:
group1: aa.
group2: AAAA.
group3: blank (nothing).
group4: AAAAAA_1.
Thanks for your help ;-).