i want to write a regex that will give me all chars that are in between exactly 3 digits. for example:
111a333b444
will return a
and b
. however, 1111a333b444
will return only b
because there are more than 3 digits to the left of a
. because there is an issue of overlapping here i used a look ahead regex such as:
matches = re.finditer(r'(?=([\\d]{3}(.){1}[\\d]{3}))',str)
but in the second example above it also matches 111a333
.
anyone has an idea for a regex that will match?
thanks a lot
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.