Приходите, давайте реорганизовать вместе.
def locations_of_substring(string, substring):
"""Return a list of locations of a substring."""
substring_length = len(substring)
def recurse(locations_found, start):
location = string.find(substring, start)
if location != -1:
return recurse(locations_found + [location], location+substring_length)
else:
return locations_found
return recurse([], 0)
print(locations_of_substring('this is a test for finding this and this', 'this'))
# prints [0, 27, 36]
Таким образом, нет необходимости в регулярных выражениях.
В вашем файле Gradle разделите идентификаторы групп и артефактов с :
вместо .
. То есть заменить
implementation 'org.nanohttpd.nanohttpd:2.3.1'
на
implementation 'org.nanohttpd:nanohttpd:2.3.1'