Repository: bast/runtest (language: python)

Issue:
Only first from_string, to_string block is extracted
Please just close this issue if it is the intended behavior.

If I'm specifying a filter
```python
f = [get_filter(from_string="start",
                to_string="end",
                abs_tolerance=1.0e-3,)]
```
and use it to filter
```python
start
0.1234
end 
start
1.2345
end
```
then only the first number will be extracted and compared.

The reason for this is the return statement [in line 48 of scissors.py](https://github.com/bast/runtest/blob/645cb7094ee133aad3d5e2c1e46a1b06b0040db8/runtest/scissors.py#L48).


Discussion / hints:
Good point ! Filter takes care of the first occurence only. 
It would maybe be more intuitive if it compared all instances? Otherwise we have now no way of checking the second and all later instances, right?

So in other words I think this was not deliberate or by design but possibly by accident.

Fix patch:
diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml
index 6b8eb9c..f18f8ea 100644
--- a/.github/workflows/package.yml
+++ b/.github/workflows/package.yml
@@ -10,7 +10,7 @@ jobs:
     runs-on: ${{ matrix.os }}
     strategy:
       matrix:
-        python-version: [3.6]
+        python-version: ["3.7"]
         os: [ubuntu-latest]
 
     steps:


Test patch:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index deb80ae..2cca325 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -12,7 +12,7 @@ jobs:
     runs-on: ${{ matrix.os }}
     strategy:
       matrix:
-        python-version: [3.6, 3.7, 3.8, 3.9, "3.10"]
+        python-version: ["3.7", "3.8", "3.9", "3.10"]
         os: [ubuntu-latest, macOS-latest, windows-latest]
 
     steps:
diff --git a/runtest/scissors.py b/runtest/scissors.py
index c512946..b00d462 100644
--- a/runtest/scissors.py
+++ b/runtest/scissors.py
@@ -45,7 +45,7 @@ def cut_sections(
                     if end_line_matches:
                         for n in range(i, j + 1):
                             output.append(text[n])
-                        return output
+                        break
 
     return output
 
@@ -100,7 +100,7 @@ def test_cut_sections_re():
         to_is_re=True,
     )
 
-    assert res == ["    raboof", "2.0", "2.0", "    raboof2"]
+    assert res == ["    raboof", "2.0", "2.0", "    raboof2", "    raboof2"]
 
 
 def test_cut_sections_all():
@@ -120,3 +120,69 @@ def test_cut_sections_all():
         "1.0 2.0 3.0",
         "last line",
     ]
+
+
+def test_cut_sections_from_string_to_string_2_matches():
+
+    text = """first line
+1.0 2.0 3.0
+start
+0.1234
+end
+start
+1.2345
+end
+1.0 2.0 3.0
+last line"""
+
+    res = cut_sections(
+        text=text.splitlines(),
+        from_string="start",
+        to_string="end",
+    )
+
+    assert res == [
+        "start",
+        "0.1234",
+        "end",
+        "start",
+        "1.2345",
+        "end",
+    ]
+
+
+def test_cut_sections_from_re_to_re_2_matches():
+
+    text = """first line
+1.0 2.0 3.0
+  raboof
+0.1234
+    raboof2
+   raboof
+1.2345
+0.2
+  raboof2
+1.0 2.0 3.0
+last line"""
+
+    res = cut_sections(
+        text=text.splitlines(),
+        from_string="r.*f",
+        from_is_re=True,
+        to_string="r.*f2",
+        to_is_re=True,
+    )
+    print("Result from cutting:")
+    print(res)
+
+    assert res == [
+        "  raboof",
+        "0.1234",
+        "    raboof2",
+        "    raboof2",
+        "   raboof",
+        "1.2345",
+        "0.2",
+        "  raboof2",
+        "  raboof2",
+    ]