Regex, with a percentage being the reference

Hey guys,

Can someone help me

Capture the highlighted number,

image

with the percentage in the top row being the default reference

Cuntratop (Take %) Montante (MWh)
COLORS (100%)                           1.878,870
COLORS                                   9,852
Toawe Cuntratop                           1.453,876

Percentage that must always be in 3 digits

Because the second line below will only appear if the percentage has 3 digits

What you mean by this? You mean when percentage is 100% or greater …9852 or any numbers will appear …is it right?

if my assumption is right…Please try this…

(?<=\d{3}%.+\n\S+\s+)[\d\,]+

OR

(?<=\d{3}%.+\n.+\s+)[\d\,]+

Hope this helps…

1 Like

that was it!!

Thank you very much!!

1 Like