Hello!

Not strong in regulars, I can not make the right one. There are lines with the following dimensions:

4x(3x1.0) -- задано три размера 5x(3x1.5) -- задано три размера 27x1.5 -- задано два размера 

You need to parse the lines and get the numbers. Made this regular season:

 (\d+).*?(\d+).*?(\d*.\d+)(?![\d.]) 

For the first two lines it works, but in the third it does not work correctly - the fraction is not correctly determined.

    1 answer 1

    Well, if you just select the group consisting of numbers, including fractions.

     ([\d.]+) 

    regex101

    • This option of course works, but then I can not determine which number belongs to which line. I would like to get groups for each row, as in the example for the first two lines I get. - Nova
    • And you do not process the data line by line? - mkkik
    • Oh, here I’ve done something. Friends suggested this option: (\ d + |) [^ \ d] * (\ d +) [^ \ d] + (\ d + \. \ D +) - Nova
    • @Nova only for line 27x1.5 get three groups `('2', '7', '1.5') in your version. - mkkik
    • Yes, I also noticed this, corrected it, now this: (\ d *?) [^ \ D] * (\ d +) [^ \ d] + (\ d + \. \ D +) - Nova