Home > other >  Can overlapping matches with the same start position be found using regex?
Can overlapping matches with the same start position be found using regex?

Time:11-30

I am looking for a regex or a regex flag in python/BigQuery that enables me to find overlapping occurrences.

For example, I have the string 1.2.5.6.8.10.12

and I would like to extract: [1., 1.2., 1.2.5., 1.2.5.6., ..., 1.2.5.6.8.10.12]

I tried running the python code re.findall("^(\d (?:\.|$)) ", string) and it resulted in ['12']

CodePudding user response:

While the regex parser enter image description here

  • Related