Update regex
Browse files
app.py
CHANGED
@@ -41,6 +41,8 @@ origins = [
|
|
41 |
"*",
|
42 |
]
|
43 |
|
|
|
|
|
44 |
app.add_middleware(
|
45 |
CORSMiddleware,
|
46 |
allow_origins=origins,
|
@@ -164,7 +166,7 @@ def get_spec_content(specification: str, version: str):
|
|
164 |
chapters = []
|
165 |
for line in toc_brut:
|
166 |
x = line.split("\t")
|
167 |
-
m = re.search(
|
168 |
if m and any(line in c for c in text[forewords[0]:forewords[1]]):
|
169 |
chapters.append(line)
|
170 |
print(line)
|
|
|
41 |
"*",
|
42 |
]
|
43 |
|
44 |
+
regex = r"^(\d+[a-z]?(?:\.\d+)*)\t[\ \S]+$"
|
45 |
+
|
46 |
app.add_middleware(
|
47 |
CORSMiddleware,
|
48 |
allow_origins=origins,
|
|
|
166 |
chapters = []
|
167 |
for line in toc_brut:
|
168 |
x = line.split("\t")
|
169 |
+
m = re.search(regex, line)
|
170 |
if m and any(line in c for c in text[forewords[0]:forewords[1]]):
|
171 |
chapters.append(line)
|
172 |
print(line)
|