0

Hi Every Regex Expert,

I have one Array List al1 like this (line by line):

al1 : L1_C1_0, L1_C2_"11229", L1_C2_"CHK_CASHING"_OK, etc... L1_C100_"FR45248624892", L2_C1_0, L2_C2_"11229", L2_C2_"CHK_CASHING"_OK etc... L2_C100_"FR45248624892"_KO, L3_C1_0, L3_C2_"11229", L3_C2_"CHK_CASHING"_OK etc... L3_C100_"FR45248624892"_KO, L4_C1_0, L3_C2_"11229", L4_C2_"CHK_CASHING"_OK etc... L4_C100_"FR45248624892"_OK

I write this regex but it doesn't work as i want :

String spattern = "(L(([1-9]?[0-9])|100)_C\\d_\\W.*?L\\2_C\\d{3}_\".*?\"(?:,?\$?))";

I want to display like this :

L1_C1_0, L1_C2_"11229", L1_C2_"CHK_CASHING"_OK, etc...L1_C100_"FR45248624892"

L2_C1_0, L2_C2_"11229", L2_C2_"CHK_CASHING"OK etc...L2_C100"FR45248624892"_KO

L3_C1_0, L3_C2_"11229", L3_C2_"CHK_CASHING"OK etc...L3_C100"FR45248624892"_KO

L4_C1_0, L3_C2_"11229", L4_C2_"CHK_CASHING"OK etc...L4_C100"FR45248624892"_OK

L5_C1_1 etc...

Some one can help me to Display this ?

Thank you very much for help

  • What do you want to match? Something like this? `\bL(?:[1-9]\d?|100)_C\d+_(?:\"[^\"]*\")?\w*` https://regex101.com/r/wWQPdC/1 – The fourth bird Jul 12 '22 at 21:04
  • Thanks for your answer but you're pattern didnt work. I would like to cut line by line this ArrayList (al1) after the comma. For example L1_C1_"blablabla"_ok – Mouss Gosling Jul 14 '22 at 16:46
  • What exactly did not work? Can you be more specific, or update the question? What is the tool or language? – The fourth bird Jul 14 '22 at 16:47
  • For example L1_C1_"blablabla"_ok, L1_C2_"kuhkhd"_KO... (then my pattern must to cut if it's encounter L2_C1_"kuhilj"_ok) same thing for L3_C1_"hkbhgcd"_ok etc... L102_C1 etc...L220_C1...) 4 digits for after the L and the C please. Tool is Katalon and language is Java – Mouss Gosling Jul 14 '22 at 16:55

0 Answers0