Answer the question
In order to leave comments, you need to log in
How to build a regex correctly?
Good day. It is necessary to get everything
from the string up to HI.JKL , that is: . Despite the fact that the numbers and letters can be different, the numbers can be either 1, 2, or 120, 130, etc.
So far, I have only come to , which displays only up to the first digit with a dot.
At the same time, in python re.findall(r,s) this expression for some reason does not display anything, although it works on any online regex builder.
It would be possible to repeat this expression three times, but it will look stupid and I'm not sure what is right.
I will be glad to any advice. A.B.CD.1.EF.2.G.3.HI.JKL
A.B.CD.1.EF.2.G.3.
^(.*?)*[0-9]\.
Answer the question
In order to leave comments, you need to log in
Judging by the description of the task, the following expression will suit you:
(([AZ]|\d)+\.?)+(?=\.\w+\.\w+)
https://regex101.com/r/zpNzD4/2
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question